Class: Io::Flow::V0::Models::OrderBuilderDestinationForm

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 = {}) ⇒ OrderBuilderDestinationForm

Returns a new instance of OrderBuilderDestinationForm.



30508
30509
30510
30511
30512
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30508

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:destination], 'OrderBuilderDestinationForm')
  @destination = (x = opts.delete(:destination); x.is_a?(::Io::Flow::V0::Models::OrderAddress) ? x : ::Io::Flow::V0::Models::OrderAddress.new(x))
end

Instance Attribute Details

#destinationObject (readonly)

Returns the value of attribute destination.



30506
30507
30508
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30506

def destination
  @destination
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



30518
30519
30520
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30518

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

#to_hashObject



30522
30523
30524
30525
30526
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30522

def to_hash
  {
    :destination => destination.to_hash
  }
end

#to_jsonObject



30514
30515
30516
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30514

def to_json
  JSON.dump(to_hash)
end