Class: Io::Flow::V0::Models::OrderBuilderCustomerForm

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

Returns a new instance of OrderBuilderCustomerForm.



45419
45420
45421
45422
45423
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45419

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

Instance Attribute Details

#customerObject (readonly)

Returns the value of attribute customer.



45417
45418
45419
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45417

def customer
  @customer
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



45429
45430
45431
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45429

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

#to_hashObject



45433
45434
45435
45436
45437
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45433

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

#to_jsonObject



45425
45426
45427
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45425

def to_json
  JSON.dump(to_hash)
end