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.



39489
39490
39491
39492
39493
39494
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39489

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.



39487
39488
39489
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39487

def from
  @from
end

#toObject (readonly)

Returns the value of attribute to.



39487
39488
39489
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39487

def to
  @to
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



39500
39501
39502
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39500

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

#to_hashObject



39504
39505
39506
39507
39508
39509
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39504

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

#to_jsonObject



39496
39497
39498
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39496

def to_json
  JSON.dump(to_hash)
end