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