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.
-
#service_id ⇒ Object
readonly
Returns the value of attribute service_id.
-
#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.
28831 28832 28833 28834 28835 28836 28837 28838 28839 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28831 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:service_id, :origin_country, :destination_country, :from, :to], 'TransitWindow') @service_id = HttpClient::Preconditions.assert_class('service_id', opts.delete(:service_id), String) @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), String) @to = HttpClient::Preconditions.assert_class('to', opts.delete(:to), String) end |
Instance Attribute Details
#destination_country ⇒ Object (readonly)
Returns the value of attribute destination_country.
28829 28830 28831 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28829 def destination_country @destination_country end |
#from ⇒ Object (readonly)
Returns the value of attribute from.
28829 28830 28831 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28829 def from @from end |
#origin_country ⇒ Object (readonly)
Returns the value of attribute origin_country.
28829 28830 28831 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28829 def origin_country @origin_country end |
#service_id ⇒ Object (readonly)
Returns the value of attribute service_id.
28829 28830 28831 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28829 def service_id @service_id end |
#to ⇒ Object (readonly)
Returns the value of attribute to.
28829 28830 28831 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28829 def to @to end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
28845 28846 28847 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28845 def copy(incoming={}) TransitWindow.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
28849 28850 28851 28852 28853 28854 28855 28856 28857 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28849 def to_hash { :service_id => service_id, :origin_country => origin_country, :destination_country => destination_country, :from => from, :to => to } end |
#to_json ⇒ Object
28841 28842 28843 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 28841 def to_json JSON.dump(to_hash) end |