Class: Io::Flow::V0::Models::ShipmentWindow
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ShipmentWindow
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#from ⇒ Object
readonly
Returns the value of attribute from.
-
#to ⇒ Object
readonly
Returns the value of attribute to.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ShipmentWindow
constructor
A new instance of ShipmentWindow.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ShipmentWindow
Returns a new instance of ShipmentWindow.
46799 46800 46801 46802 46803 46804 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46799 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:from, :to], 'ShipmentWindow') @from = HttpClient::Preconditions.assert_class('from', opts.delete(:from), Integer) @to = HttpClient::Preconditions.assert_class('to', opts.delete(:to), Integer) end |
Instance Attribute Details
#from ⇒ Object (readonly)
Returns the value of attribute from.
46797 46798 46799 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46797 def from @from end |
#to ⇒ Object (readonly)
Returns the value of attribute to.
46797 46798 46799 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46797 def to @to end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
46810 46811 46812 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46810 def copy(incoming={}) ShipmentWindow.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
46814 46815 46816 46817 46818 46819 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46814 def to_hash { :from => from, :to => to } end |
#to_json ⇒ Object
46806 46807 46808 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 46806 def to_json JSON.dump(to_hash) end |