Class: Io::Flow::V0::Models::PaymentAddressBilling

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

Returns a new instance of PaymentAddressBilling.



56327
56328
56329
56330
56331
56332
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56327

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

Instance Attribute Details

#contactObject (readonly)

Returns the value of attribute contact.



56325
56326
56327
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56325

def contact
  @contact
end

#locationObject (readonly)

Returns the value of attribute location.



56325
56326
56327
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56325

def location
  @location
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



56338
56339
56340
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56338

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

#to_hashObject



56342
56343
56344
56345
56346
56347
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56342

def to_hash
  {
    :contact => contact.to_hash,
    :location => location.to_hash
  }
end

#to_jsonObject



56334
56335
56336
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56334

def to_json
  JSON.dump(to_hash)
end