Class: Io::Flow::V0::Models::PaymentAddressShipping

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

Returns a new instance of PaymentAddressShipping.



56355
56356
56357
56358
56359
56360
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56355

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:contact, :location], 'PaymentAddressShipping')
  @contact = (x = opts.delete(:contact); x.is_a?(::Io::Flow::V0::Models::PaymentContactShipping) ? x : ::Io::Flow::V0::Models::PaymentContactShipping.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.



56353
56354
56355
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56353

def contact
  @contact
end

#locationObject (readonly)

Returns the value of attribute location.



56353
56354
56355
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56353

def location
  @location
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



56366
56367
56368
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56366

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

#to_hashObject



56370
56371
56372
56373
56374
56375
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56370

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

#to_jsonObject



56362
56363
56364
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56362

def to_json
  JSON.dump(to_hash)
end