Class: Io::Flow::V0::Models::ReservationItem
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ReservationItem
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#item ⇒ Object
readonly
Returns the value of attribute item.
-
#quantity ⇒ Object
readonly
Returns the value of attribute quantity.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ReservationItem
constructor
A new instance of ReservationItem.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ReservationItem
Returns a new instance of ReservationItem.
63794 63795 63796 63797 63798 63799 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63794 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:item, :quantity], 'ReservationItem') @item = (x = opts.delete(:item); x.is_a?(::Io::Flow::V0::Models::ReservationItemReference) ? x : ::Io::Flow::V0::Models::ReservationItemReference.new(x)) @quantity = HttpClient::Preconditions.assert_class('quantity', opts.delete(:quantity), Integer) end |
Instance Attribute Details
#item ⇒ Object (readonly)
Returns the value of attribute item.
63792 63793 63794 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63792 def item @item end |
#quantity ⇒ Object (readonly)
Returns the value of attribute quantity.
63792 63793 63794 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63792 def quantity @quantity end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
63805 63806 63807 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63805 def copy(incoming={}) ReservationItem.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
63809 63810 63811 63812 63813 63814 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63809 def to_hash { :item => item.to_hash, :quantity => quantity } end |
#to_json ⇒ Object
63801 63802 63803 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 63801 def to_json JSON.dump(to_hash) end |