Class: Subsify::Subscription

Inherits:
Object
  • Object
show all
Defined in:
lib/subsify/subscription.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_onObject (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_dueObject (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

#planObject (readonly)

Returns the value of attribute plan.



4
5
6
# File 'lib/subsify/subscription.rb', line 4

def plan
  @plan
end

#statusObject (readonly)

Returns the value of attribute status.



4
5
6
# File 'lib/subsify/subscription.rb', line 4

def status
  @status
end