Class: Io::Flow::V0::Models::CardForm
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::CardForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#challenge_cipher ⇒ Object
readonly
Returns the value of attribute challenge_cipher.
-
#challenge_text ⇒ Object
readonly
Returns the value of attribute challenge_text.
-
#cipher ⇒ Object
readonly
Returns the value of attribute cipher.
-
#cvv ⇒ Object
readonly
Returns the value of attribute cvv.
-
#expiration_month ⇒ Object
readonly
Returns the value of attribute expiration_month.
-
#expiration_year ⇒ Object
readonly
Returns the value of attribute expiration_year.
-
#ip ⇒ Object
readonly
Returns the value of attribute ip.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ CardForm
constructor
A new instance of CardForm.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ CardForm
Returns a new instance of CardForm.
12886 12887 12888 12889 12890 12891 12892 12893 12894 12895 12896 12897 12898 12899 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12886 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:expiration_month, :expiration_year, :name, :cvv], 'CardForm') @number = (x = opts.delete(:number); x.nil? ? nil : HttpClient::Preconditions.assert_class('number', x, String)) @cipher = (x = opts.delete(:cipher); x.nil? ? nil : HttpClient::Preconditions.assert_class('cipher', x, String)) @expiration_month = HttpClient::Preconditions.assert_class('expiration_month', opts.delete(:expiration_month), Integer) @expiration_year = HttpClient::Preconditions.assert_class('expiration_year', opts.delete(:expiration_year), Integer) @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String) @cvv = HttpClient::Preconditions.assert_class('cvv', opts.delete(:cvv), String) @address = (x = opts.delete(:address); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Address) ? x : ::Io::Flow::V0::Models::Address.new(x))) @ip = (x = opts.delete(:ip); x.nil? ? nil : HttpClient::Preconditions.assert_class('ip', x, String)) @challenge_text = (x = opts.delete(:challenge_text); x.nil? ? nil : HttpClient::Preconditions.assert_class('challenge_text', x, String)) @challenge_cipher = (x = opts.delete(:challenge_cipher); x.nil? ? nil : HttpClient::Preconditions.assert_class('challenge_cipher', x, String)) end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
12884 12885 12886 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12884 def address @address end |
#challenge_cipher ⇒ Object (readonly)
Returns the value of attribute challenge_cipher.
12884 12885 12886 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12884 def challenge_cipher @challenge_cipher end |
#challenge_text ⇒ Object (readonly)
Returns the value of attribute challenge_text.
12884 12885 12886 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12884 def challenge_text @challenge_text end |
#cipher ⇒ Object (readonly)
Returns the value of attribute cipher.
12884 12885 12886 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12884 def cipher @cipher end |
#cvv ⇒ Object (readonly)
Returns the value of attribute cvv.
12884 12885 12886 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12884 def cvv @cvv end |
#expiration_month ⇒ Object (readonly)
Returns the value of attribute expiration_month.
12884 12885 12886 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12884 def expiration_month @expiration_month end |
#expiration_year ⇒ Object (readonly)
Returns the value of attribute expiration_year.
12884 12885 12886 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12884 def expiration_year @expiration_year end |
#ip ⇒ Object (readonly)
Returns the value of attribute ip.
12884 12885 12886 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12884 def ip @ip end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
12884 12885 12886 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12884 def name @name end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
12884 12885 12886 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12884 def number @number end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
12905 12906 12907 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12905 def copy(incoming={}) CardForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
12909 12910 12911 12912 12913 12914 12915 12916 12917 12918 12919 12920 12921 12922 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12909 def to_hash { :number => number, :cipher => cipher, :expiration_month => expiration_month, :expiration_year => expiration_year, :name => name, :cvv => cvv, :address => address.nil? ? nil : address.to_hash, :ip => ip, :challenge_text => challenge_text, :challenge_cipher => challenge_cipher } end |
#to_json ⇒ Object
12901 12902 12903 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12901 def to_json JSON.dump(to_hash) end |