Class: Subsify::Card
- Inherits:
-
Object
- Object
- Subsify::Card
- Defined in:
- lib/subsify/card.rb
Instance Attribute Summary collapse
-
#expires_on ⇒ Object
readonly
Returns the value of attribute expires_on.
-
#last_four ⇒ Object
readonly
Returns the value of attribute last_four.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(data) ⇒ Card
constructor
A new instance of Card.
Constructor Details
#initialize(data) ⇒ Card
Returns a new instance of Card.
5 6 7 8 9 |
# File 'lib/subsify/card.rb', line 5 def initialize(data) @last_four = data['last_four'] @type = data['card_type'] @expires_on = Date.parse(data['expires_on']) end |
Instance Attribute Details
#expires_on ⇒ Object (readonly)
Returns the value of attribute expires_on.
4 5 6 |
# File 'lib/subsify/card.rb', line 4 def expires_on @expires_on end |
#last_four ⇒ Object (readonly)
Returns the value of attribute last_four.
4 5 6 |
# File 'lib/subsify/card.rb', line 4 def last_four @last_four end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
4 5 6 |
# File 'lib/subsify/card.rb', line 4 def type @type end |