class Io::Flow::V0::Models::CheckoutItemContent
A Checkout Item
Content provides information about an item to support rendering of that item in the context of checkout
Attributes
attributes[R]
description[R]
image[R]
item[R]
name[R]
Public Class Methods
new(incoming={})
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 35975 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:item, :name, :attributes], 'CheckoutItemContent') @item = (x = opts.delete(:item); x.is_a?(::Io::Flow::V0::Models::Item) ? x : ::Io::Flow::V0::Models::Item.new(x)) @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String) @description = (x = opts.delete(:description); x.nil? ? nil : HttpClient::Preconditions.assert_class('description', x, String)) @attributes = HttpClient::Preconditions.assert_class('attributes', opts.delete(:attributes), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::CheckoutItemContentAttribute) ? x : ::Io::Flow::V0::Models::CheckoutItemContentAttribute.new(x)) } @image = (x = opts.delete(:image); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Image) ? x : ::Io::Flow::V0::Models::Image.new(x))) end
Public Instance Methods
copy(incoming={})
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 35989 def copy(incoming={}) CheckoutItemContent.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 35993 def to_hash { :item => item.to_hash, :name => name, :description => description, :attributes => attributes.map { |o| o.to_hash }, :image => image.nil? ? nil : image.to_hash } end
to_json()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 35985 def to_json JSON.dump(to_hash) end