Class: Pin::Card
Instance Attribute Summary collapse
-
#address_city ⇒ Object
Returns the value of attribute address_city.
-
#address_country ⇒ Object
Returns the value of attribute address_country.
-
#address_line1 ⇒ Object
Returns the value of attribute address_line1.
-
#address_line2 ⇒ Object
Returns the value of attribute address_line2.
-
#address_postcode ⇒ Object
Returns the value of attribute address_postcode.
-
#address_state ⇒ Object
Returns the value of attribute address_state.
-
#cvc ⇒ Object
Returns the value of attribute cvc.
-
#display_number ⇒ Object
Returns the value of attribute display_number.
-
#expiry_month ⇒ Object
Returns the value of attribute expiry_month.
-
#expiry_year ⇒ Object
Returns the value of attribute expiry_year.
-
#name ⇒ Object
Returns the value of attribute name.
-
#number ⇒ Object
Returns the value of attribute number.
-
#scheme ⇒ Object
Returns the value of attribute scheme.
-
#token ⇒ Object
Returns the value of attribute token.
Class Method Summary collapse
-
.create(options = {}) ⇒ Object
options should be a hash with the following keys: :number, :expiry_month, :expiry_year, :cvc, :name, :address_line1, :address_city, :address_postcode, :address_state, :address_country.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Card
constructor
A new instance of Card.
- #to_hash ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(attributes = {}) ⇒ Card
Returns a new instance of Card.
8 9 10 |
# File 'lib/pin-payments/card.rb', line 8 def initialize(attributes = {}) attributes.each {|name, value| send("#{name}=", value)} end |
Instance Attribute Details
#address_city ⇒ Object
Returns the value of attribute address_city.
3 4 5 |
# File 'lib/pin-payments/card.rb', line 3 def address_city @address_city end |
#address_country ⇒ Object
Returns the value of attribute address_country.
3 4 5 |
# File 'lib/pin-payments/card.rb', line 3 def address_country @address_country end |
#address_line1 ⇒ Object
Returns the value of attribute address_line1.
3 4 5 |
# File 'lib/pin-payments/card.rb', line 3 def address_line1 @address_line1 end |
#address_line2 ⇒ Object
Returns the value of attribute address_line2.
3 4 5 |
# File 'lib/pin-payments/card.rb', line 3 def address_line2 @address_line2 end |
#address_postcode ⇒ Object
Returns the value of attribute address_postcode.
3 4 5 |
# File 'lib/pin-payments/card.rb', line 3 def address_postcode @address_postcode end |
#address_state ⇒ Object
Returns the value of attribute address_state.
3 4 5 |
# File 'lib/pin-payments/card.rb', line 3 def address_state @address_state end |
#cvc ⇒ Object
Returns the value of attribute cvc.
3 4 5 |
# File 'lib/pin-payments/card.rb', line 3 def cvc @cvc end |
#display_number ⇒ Object
Returns the value of attribute display_number.
3 4 5 |
# File 'lib/pin-payments/card.rb', line 3 def display_number @display_number end |
#expiry_month ⇒ Object
Returns the value of attribute expiry_month.
3 4 5 |
# File 'lib/pin-payments/card.rb', line 3 def expiry_month @expiry_month end |
#expiry_year ⇒ Object
Returns the value of attribute expiry_year.
3 4 5 |
# File 'lib/pin-payments/card.rb', line 3 def expiry_year @expiry_year end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/pin-payments/card.rb', line 3 def name @name end |
#number ⇒ Object
Returns the value of attribute number.
3 4 5 |
# File 'lib/pin-payments/card.rb', line 3 def number @number end |
#scheme ⇒ Object
Returns the value of attribute scheme.
3 4 5 |
# File 'lib/pin-payments/card.rb', line 3 def scheme @scheme end |
#token ⇒ Object
Returns the value of attribute token.
3 4 5 |
# File 'lib/pin-payments/card.rb', line 3 def token @token end |
Class Method Details
.create(options = {}) ⇒ Object
options should be a hash with the following keys: :number, :expiry_month, :expiry_year, :cvc, :name, :address_line1, :address_city, :address_postcode, :address_state, :address_country
it can also have the following optional keys: :address_line2
25 26 27 |
# File 'lib/pin-payments/card.rb', line 25 def create( = {}) super() end |
Instance Method Details
#to_hash ⇒ Object
12 13 14 15 16 |
# File 'lib/pin-payments/card.rb', line 12 def to_hash hash = {} instance_variables.each {|var| hash[var.to_s.delete("@")] = instance_variable_get(var) } hash end |