Class: Exchequer::Card
- Inherits:
-
Object
- Object
- Exchequer::Card
- Defined in:
- lib/exchequer/card.rb
Instance Attribute Summary collapse
-
#billing_address ⇒ Object
Returns the value of attribute billing_address.
-
#billing_city ⇒ Object
Returns the value of attribute billing_city.
-
#billing_country ⇒ Object
Returns the value of attribute billing_country.
-
#billing_state ⇒ Object
Returns the value of attribute billing_state.
-
#billing_zip ⇒ Object
Returns the value of attribute billing_zip.
-
#cvv ⇒ Object
Returns the value of attribute cvv.
-
#expiration_month ⇒ Object
Returns the value of attribute expiration_month.
-
#expiration_year ⇒ Object
Returns the value of attribute expiration_year.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#full_number ⇒ Object
Returns the value of attribute full_number.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(params = {}) ⇒ Card
constructor
A new instance of Card.
- #to_hash ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ Card
Returns a new instance of Card.
6 7 8 9 10 11 |
# File 'lib/exchequer/card.rb', line 6 def initialize(params = {}) params ||= {} params.keys.each do |key| send "#{key}=", params[key] end end |
Instance Attribute Details
#billing_address ⇒ Object
Returns the value of attribute billing_address.
2 3 4 |
# File 'lib/exchequer/card.rb', line 2 def billing_address @billing_address end |
#billing_city ⇒ Object
Returns the value of attribute billing_city.
2 3 4 |
# File 'lib/exchequer/card.rb', line 2 def billing_city @billing_city end |
#billing_country ⇒ Object
Returns the value of attribute billing_country.
2 3 4 |
# File 'lib/exchequer/card.rb', line 2 def billing_country @billing_country end |
#billing_state ⇒ Object
Returns the value of attribute billing_state.
2 3 4 |
# File 'lib/exchequer/card.rb', line 2 def billing_state @billing_state end |
#billing_zip ⇒ Object
Returns the value of attribute billing_zip.
2 3 4 |
# File 'lib/exchequer/card.rb', line 2 def billing_zip @billing_zip end |
#cvv ⇒ Object
Returns the value of attribute cvv.
2 3 4 |
# File 'lib/exchequer/card.rb', line 2 def cvv @cvv end |
#expiration_month ⇒ Object
Returns the value of attribute expiration_month.
2 3 4 |
# File 'lib/exchequer/card.rb', line 2 def expiration_month @expiration_month end |
#expiration_year ⇒ Object
Returns the value of attribute expiration_year.
2 3 4 |
# File 'lib/exchequer/card.rb', line 2 def expiration_year @expiration_year end |
#first_name ⇒ Object
Returns the value of attribute first_name.
2 3 4 |
# File 'lib/exchequer/card.rb', line 2 def first_name @first_name end |
#full_number ⇒ Object
Returns the value of attribute full_number.
2 3 4 |
# File 'lib/exchequer/card.rb', line 2 def full_number @full_number end |
#last_name ⇒ Object
Returns the value of attribute last_name.
2 3 4 |
# File 'lib/exchequer/card.rb', line 2 def last_name @last_name end |
Instance Method Details
#errors ⇒ Object
13 14 15 |
# File 'lib/exchequer/card.rb', line 13 def errors @errors ||= ActiveModel::Errors.new(self) end |
#to_hash ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/exchequer/card.rb', line 17 def to_hash { 'first_name' => first_name, 'last_name' => last_name, 'full_number' => full_number, 'cvv' => cvv, 'expiration_month' => expiration_month, 'expiration_year' => expiration_year, 'billing_address' => billing_address, 'billing_city' => billing_city, 'billing_state' => billing_state, 'billing_zip' => billing_zip, 'billing_country' => billing_country } end |