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.



51659
51660
51661
51662
51663
51664
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51659

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.



51657
51658
51659
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51657

def id
  @id
end

#labelObject (readonly)

Returns the value of attribute label.



51657
51658
51659
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51657

def label
  @label
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



51670
51671
51672
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51670

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

#to_hashObject



51674
51675
51676
51677
51678
51679
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51674

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

#to_jsonObject



51666
51667
51668
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51666

def to_json
  JSON.dump(to_hash)
end