Class: Io::Flow::V0::Models::ReservationSerialReference
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ReservationSerialReference
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#center ⇒ Object
readonly
Returns the value of attribute center.
-
#item_price ⇒ Object
readonly
Returns the value of attribute item_price.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ReservationSerialReference
constructor
A new instance of ReservationSerialReference.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ReservationSerialReference
Returns a new instance of ReservationSerialReference.
30339 30340 30341 30342 30343 30344 30345 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30339 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:number, :item_price, :center], 'ReservationSerialReference') @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String) @item_price = (x = opts.delete(:item_price); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x)) @center = (x = opts.delete(:center); x.is_a?(::Io::Flow::V0::Models::CenterReference) ? x : ::Io::Flow::V0::Models::CenterReference.new(x)) end |
Instance Attribute Details
#center ⇒ Object (readonly)
Returns the value of attribute center.
30337 30338 30339 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30337 def center @center end |
#item_price ⇒ Object (readonly)
Returns the value of attribute item_price.
30337 30338 30339 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30337 def item_price @item_price end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
30337 30338 30339 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30337 def number @number end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
30351 30352 30353 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30351 def copy(incoming={}) ReservationSerialReference.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
30355 30356 30357 30358 30359 30360 30361 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30355 def to_hash { :number => number, :item_price => item_price.to_hash, :center => center.to_hash } end |
#to_json ⇒ Object
30347 30348 30349 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30347 def to_json JSON.dump(to_hash) end |