Class: Io::Flow::V0::Models::PaymentMethodCardNumberCleartext

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

Instance Attribute Summary collapse

Attributes inherited from CardNumber

#type

Instance Method Summary collapse

Methods inherited from CardNumber

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ PaymentMethodCardNumberCleartext

Returns a new instance of PaymentMethodCardNumberCleartext.



50658
50659
50660
50661
50662
50663
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50658

def initialize(incoming={})
  super(:type => CardNumber::Types::PAYMENT_METHOD_CARD_NUMBER_CLEARTEXT)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:number], 'PaymentMethodCardNumberCleartext')
  @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
end

Instance Attribute Details

#numberObject (readonly)

Returns the value of attribute number.



50656
50657
50658
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50656

def number
  @number
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



50669
50670
50671
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50669

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

#subtype_to_hashObject



50673
50674
50675
50676
50677
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50673

def subtype_to_hash
  {
    :number => number
  }
end

#to_jsonObject



50665
50666
50667
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50665

def to_json
  JSON.dump(to_hash)
end