Class: Io::Flow::V0::Models::ShippingLaneForm
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ShippingLaneForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#from ⇒ Object
readonly
Returns the value of attribute from.
-
#strategy ⇒ Object
readonly
Returns the value of attribute strategy.
-
#to ⇒ Object
readonly
Returns the value of attribute to.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ShippingLaneForm
constructor
A new instance of ShippingLaneForm.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ShippingLaneForm
Returns a new instance of ShippingLaneForm.
44951 44952 44953 44954 44955 44956 44957 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44951 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:from, :to], 'ShippingLaneForm') @from = HttpClient::Preconditions.assert_class('from', opts.delete(:from), String) @to = HttpClient::Preconditions.assert_class('to', opts.delete(:to), String) @strategy = (x = opts.delete(:strategy); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::LaneStrategy) ? x : ::Io::Flow::V0::Models::LaneStrategy.apply(x))) end |
Instance Attribute Details
#from ⇒ Object (readonly)
Returns the value of attribute from.
44949 44950 44951 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44949 def from @from end |
#strategy ⇒ Object (readonly)
Returns the value of attribute strategy.
44949 44950 44951 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44949 def strategy @strategy end |
#to ⇒ Object (readonly)
Returns the value of attribute to.
44949 44950 44951 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44949 def to @to end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
44963 44964 44965 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44963 def copy(incoming={}) ShippingLaneForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
44967 44968 44969 44970 44971 44972 44973 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44967 def to_hash { :from => from, :to => to, :strategy => strategy.nil? ? nil : strategy.value } end |
#to_json ⇒ Object
44959 44960 44961 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44959 def to_json JSON.dump(to_hash) end |