Class: Io::Flow::V0::Models::PaymentMethodCardNumberCipher

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

Returns a new instance of PaymentMethodCardNumberCipher.



50631
50632
50633
50634
50635
50636
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50631

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

Instance Attribute Details

#cipherObject (readonly)

Returns the value of attribute cipher.



50629
50630
50631
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50629

def cipher
  @cipher
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



50642
50643
50644
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50642

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

#subtype_to_hashObject



50646
50647
50648
50649
50650
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50646

def subtype_to_hash
  {
    :cipher => cipher
  }
end

#to_jsonObject



50638
50639
50640
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50638

def to_json
  JSON.dump(to_hash)
end