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.



25420
25421
25422
25423
25424
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25420

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.



25418
25419
25420
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25418

def destination
  @destination
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



25430
25431
25432
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25430

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

#to_hashObject



25434
25435
25436
25437
25438
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25434

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

#to_jsonObject



25426
25427
25428
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25426

def to_json
  JSON.dump(to_hash)
end