Class: Creditcard
- Inherits:
-
Object
- Object
- Creditcard
- Extended by:
- ActiveModel::Callbacks, ActiveModel::Naming
- Includes:
- ActiveModel::Conversion, ActiveModel::Validations, ActiveModel::Validations::Callbacks
- Defined in:
- app/models/creditcard.rb
Instance Attribute Summary collapse
-
#address1 ⇒ Object
Returns the value of attribute address1.
-
#address2 ⇒ Object
Returns the value of attribute address2.
-
#cardtype ⇒ Object
Returns the value of attribute cardtype.
-
#cvv ⇒ Object
(also: #verification_value)
Returns the value of attribute cvv.
-
#expires_on ⇒ Object
Returns the value of attribute expires_on.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#month ⇒ Object
Returns the value of attribute month.
-
#number ⇒ Object
Returns the value of attribute number.
-
#state ⇒ Object
Returns the value of attribute state.
-
#year ⇒ Object
Returns the value of attribute year.
-
#zipcode ⇒ Object
Returns the value of attribute zipcode.
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ Creditcard
constructor
A new instance of Creditcard.
- #persisted? ⇒ Boolean
- #verification_value? ⇒ Boolean
Constructor Details
#initialize(attrs = {}) ⇒ Creditcard
Returns a new instance of Creditcard.
26 27 28 29 30 31 32 |
# File 'app/models/creditcard.rb', line 26 def initialize(attrs = {}) sanitize_month_and_year(attrs) attrs.each do | name, value | send("#{name}=", value) end end |
Instance Attribute Details
#address1 ⇒ Object
Returns the value of attribute address1.
8 9 10 |
# File 'app/models/creditcard.rb', line 8 def address1 @address1 end |
#address2 ⇒ Object
Returns the value of attribute address2.
8 9 10 |
# File 'app/models/creditcard.rb', line 8 def address2 @address2 end |
#cardtype ⇒ Object
Returns the value of attribute cardtype.
9 10 11 |
# File 'app/models/creditcard.rb', line 9 def cardtype @cardtype end |
#cvv ⇒ Object Also known as: verification_value
Returns the value of attribute cvv.
9 10 11 |
# File 'app/models/creditcard.rb', line 9 def cvv @cvv end |
#expires_on ⇒ Object
Returns the value of attribute expires_on.
9 10 11 |
# File 'app/models/creditcard.rb', line 9 def expires_on @expires_on end |
#first_name ⇒ Object
Returns the value of attribute first_name.
8 9 10 |
# File 'app/models/creditcard.rb', line 8 def first_name @first_name end |
#last_name ⇒ Object
Returns the value of attribute last_name.
8 9 10 |
# File 'app/models/creditcard.rb', line 8 def last_name @last_name end |
#month ⇒ Object
Returns the value of attribute month.
9 10 11 |
# File 'app/models/creditcard.rb', line 9 def month @month end |
#number ⇒ Object
Returns the value of attribute number.
9 10 11 |
# File 'app/models/creditcard.rb', line 9 def number @number end |
#state ⇒ Object
Returns the value of attribute state.
8 9 10 |
# File 'app/models/creditcard.rb', line 8 def state @state end |
#year ⇒ Object
Returns the value of attribute year.
9 10 11 |
# File 'app/models/creditcard.rb', line 9 def year @year end |
#zipcode ⇒ Object
Returns the value of attribute zipcode.
8 9 10 |
# File 'app/models/creditcard.rb', line 8 def zipcode @zipcode end |
Instance Method Details
#persisted? ⇒ Boolean
38 39 40 |
# File 'app/models/creditcard.rb', line 38 def persisted? false end |
#verification_value? ⇒ Boolean
34 35 36 |
# File 'app/models/creditcard.rb', line 34 def verification_value? true # ActiveMerchant needs this end |