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.



39887
39888
39889
39890
39891
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39887

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.



39885
39886
39887
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39885

def destination
  @destination
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



39897
39898
39899
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39897

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

#to_hashObject



39901
39902
39903
39904
39905
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39901

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

#to_jsonObject



39893
39894
39895
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39893

def to_json
  JSON.dump(to_hash)
end