Class: Io::Flow::V0::Models::CsvPriceBookItemExportRowByItemNumber
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::CsvPriceBookItemExportRowByItemNumber
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#item_attributes ⇒ Object
readonly
Returns the value of attribute item_attributes.
-
#item_name ⇒ Object
readonly
Returns the value of attribute item_name.
-
#item_number ⇒ Object
readonly
Returns the value of attribute item_number.
-
#price_book_item_key ⇒ Object
readonly
Returns the value of attribute price_book_item_key.
-
#price_book_key ⇒ Object
readonly
Returns the value of attribute price_book_key.
-
#schedule ⇒ Object
readonly
Returns the value of attribute schedule.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ CsvPriceBookItemExportRowByItemNumber
constructor
A new instance of CsvPriceBookItemExportRowByItemNumber.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ CsvPriceBookItemExportRowByItemNumber
Returns a new instance of CsvPriceBookItemExportRowByItemNumber.
34672 34673 34674 34675 34676 34677 34678 34679 34680 34681 34682 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34672 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:item_number, :price_book_key, :price_book_item_key, :item_name, :amount, :schedule], 'CsvPriceBookItemExportRowByItemNumber') @item_number = HttpClient::Preconditions.assert_class('item_number', opts.delete(:item_number), String) @price_book_key = HttpClient::Preconditions.assert_class('price_book_key', opts.delete(:price_book_key), String) @price_book_item_key = HttpClient::Preconditions.assert_class('price_book_item_key', opts.delete(:price_book_item_key), String) @item_name = HttpClient::Preconditions.assert_class('item_name', opts.delete(:item_name), String) @amount = HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(opts.delete(:amount)), BigDecimal) @item_attributes = (x = opts.delete(:item_attributes); x.nil? ? nil : HttpClient::Preconditions.assert_class('item_attributes', x, Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('item_attributes', d[1], String); h }) @schedule = (x = opts.delete(:schedule); x.is_a?(::Io::Flow::V0::Models::PriceBookItemSchedule) ? x : ::Io::Flow::V0::Models::PriceBookItemSchedule.new(x)) end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
34670 34671 34672 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34670 def amount @amount end |
#item_attributes ⇒ Object (readonly)
Returns the value of attribute item_attributes.
34670 34671 34672 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34670 def item_attributes @item_attributes end |
#item_name ⇒ Object (readonly)
Returns the value of attribute item_name.
34670 34671 34672 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34670 def item_name @item_name end |
#item_number ⇒ Object (readonly)
Returns the value of attribute item_number.
34670 34671 34672 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34670 def item_number @item_number end |
#price_book_item_key ⇒ Object (readonly)
Returns the value of attribute price_book_item_key.
34670 34671 34672 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34670 def price_book_item_key @price_book_item_key end |
#price_book_key ⇒ Object (readonly)
Returns the value of attribute price_book_key.
34670 34671 34672 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34670 def price_book_key @price_book_key end |
#schedule ⇒ Object (readonly)
Returns the value of attribute schedule.
34670 34671 34672 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34670 def schedule @schedule end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
34688 34689 34690 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34688 def copy(incoming={}) CsvPriceBookItemExportRowByItemNumber.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
34692 34693 34694 34695 34696 34697 34698 34699 34700 34701 34702 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34692 def to_hash { :item_number => item_number, :price_book_key => price_book_key, :price_book_item_key => price_book_item_key, :item_name => item_name, :amount => amount.to_f.to_s, :item_attributes => item_attributes.nil? ? nil : item_attributes, :schedule => schedule.to_hash } end |
#to_json ⇒ Object
34684 34685 34686 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34684 def to_json JSON.dump(to_hash) end |