class Io::Flow::V0::Models::KlaviyoOrderContent
Attributes
checkout_url[R]
line_items[R]
prices[R]
Public Class Methods
new(incoming={})
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 47854 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:line_items, :prices, :checkout_url], 'KlaviyoOrderContent') @line_items = HttpClient::Preconditions.assert_class('line_items', opts.delete(:line_items), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::KlaviyoLineItem) ? x : ::Io::Flow::V0::Models::KlaviyoLineItem.new(x)) } @prices = (x = opts.delete(:prices); x.is_a?(::Io::Flow::V0::Models::KlaviyoOrderPrices) ? x : ::Io::Flow::V0::Models::KlaviyoOrderPrices.new(x)) @checkout_url = HttpClient::Preconditions.assert_class('checkout_url', opts.delete(:checkout_url), String) end
Public Instance Methods
copy(incoming={})
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 47866 def copy(incoming={}) KlaviyoOrderContent.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end
to_hash()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 47870 def to_hash { :line_items => line_items.map { |o| o.to_hash }, :prices => prices.to_hash, :checkout_url => checkout_url } end
to_json()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 47862 def to_json JSON.dump(to_hash) end