Class: Io::Flow::V0::Models::PaymentProcessorIdentifier

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

Returns a new instance of PaymentProcessorIdentifier.



58424
58425
58426
58427
58428
58429
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58424

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:id, :label], 'PaymentProcessorIdentifier')
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
  @label = HttpClient::Preconditions.assert_class('label', opts.delete(:label), String)
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



58422
58423
58424
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58422

def id
  @id
end

#labelObject (readonly)

Returns the value of attribute label.



58422
58423
58424
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58422

def label
  @label
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



58435
58436
58437
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58435

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

#to_hashObject



58439
58440
58441
58442
58443
58444
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58439

def to_hash
  {
    :id => id,
    :label => label
  }
end

#to_jsonObject



58431
58432
58433
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 58431

def to_json
  JSON.dump(to_hash)
end