Class: Io::Flow::V0::Models::ShippingLaneForm

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ ShippingLaneForm

Returns a new instance of ShippingLaneForm.



40856
40857
40858
40859
40860
40861
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40856

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)
end

Instance Attribute Details

#fromObject (readonly)

Returns the value of attribute from.



40854
40855
40856
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40854

def from
  @from
end

#toObject (readonly)

Returns the value of attribute to.



40854
40855
40856
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40854

def to
  @to
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



40867
40868
40869
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40867

def copy(incoming={})
  ShippingLaneForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



40871
40872
40873
40874
40875
40876
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40871

def to_hash
  {
    :from => from,
    :to => to
  }
end

#to_jsonObject



40863
40864
40865
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40863

def to_json
  JSON.dump(to_hash)
end