Class: Io::Flow::V0::Models::SurchargeResponsiblePartyDisplay

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Overview

Surcharge responsible parties that can be displayed and selected

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ SurchargeResponsiblePartyDisplay

Returns a new instance of SurchargeResponsiblePartyDisplay.



64353
64354
64355
64356
64357
64358
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64353

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:name, :responsible_party], 'SurchargeResponsiblePartyDisplay')
  @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
  @responsible_party = (x = opts.delete(:responsible_party); x.is_a?(::Io::Flow::V0::Models::SurchargeResponsibleParty) ? x : ::Io::Flow::V0::Models::SurchargeResponsibleParty.apply(x))
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



64351
64352
64353
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64351

def name
  @name
end

#responsible_partyObject (readonly)

Returns the value of attribute responsible_party.



64351
64352
64353
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64351

def responsible_party
  @responsible_party
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



64364
64365
64366
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64364

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

#to_hashObject



64368
64369
64370
64371
64372
64373
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64368

def to_hash
  {
    :name => name,
    :responsible_party => responsible_party.value
  }
end

#to_jsonObject



64360
64361
64362
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 64360

def to_json
  JSON.dump(to_hash)
end