Class: Io::Flow::V0::Models::TransitWindow
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::TransitWindow
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#destination_country ⇒ Object
readonly
Returns the value of attribute destination_country.
-
#from ⇒ Object
readonly
Returns the value of attribute from.
-
#origin_country ⇒ Object
readonly
Returns the value of attribute origin_country.
-
#to ⇒ Object
readonly
Returns the value of attribute to.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ TransitWindow
constructor
A new instance of TransitWindow.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ TransitWindow
Returns a new instance of TransitWindow.
38433 38434 38435 38436 38437 38438 38439 38440 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38433 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:origin_country, :destination_country, :from, :to], 'TransitWindow') @origin_country = HttpClient::Preconditions.assert_class('origin_country', opts.delete(:origin_country), String) @destination_country = HttpClient::Preconditions.assert_class('destination_country', opts.delete(:destination_country), String) @from = HttpClient::Preconditions.assert_class('from', opts.delete(:from), Integer) @to = HttpClient::Preconditions.assert_class('to', opts.delete(:to), Integer) end |
Instance Attribute Details
#destination_country ⇒ Object (readonly)
Returns the value of attribute destination_country.
38431 38432 38433 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38431 def destination_country @destination_country end |
#from ⇒ Object (readonly)
Returns the value of attribute from.
38431 38432 38433 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38431 def from @from end |
#origin_country ⇒ Object (readonly)
Returns the value of attribute origin_country.
38431 38432 38433 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38431 def origin_country @origin_country end |
#to ⇒ Object (readonly)
Returns the value of attribute to.
38431 38432 38433 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38431 def to @to end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
38446 38447 38448 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38446 def copy(incoming={}) TransitWindow.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
38450 38451 38452 38453 38454 38455 38456 38457 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38450 def to_hash { :origin_country => origin_country, :destination_country => destination_country, :from => from, :to => to } end |
#to_json ⇒ Object
38442 38443 38444 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38442 def to_json JSON.dump(to_hash) end |