Class: HookBridge::Subscription

Inherits:
Object
  • Object
show all
Defined in:
lib/hookbridge/types.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Subscription

Returns a new instance of Subscription.



313
314
315
316
317
318
319
320
# File 'lib/hookbridge/types.rb', line 313

def initialize(data)
  @plan = data["plan"]
  @status = data["status"]
  @limits = SubscriptionLimits.new(data["limits"] || {})
  @usage = SubscriptionUsage.new(data["usage"] || {})
  @cancel_at_period_end = data["cancel_at_period_end"]
  @current_period_end = data["current_period_end"] ? Time.parse(data["current_period_end"]) : nil
end

Instance Attribute Details

#cancel_at_period_endObject (readonly)

Returns the value of attribute cancel_at_period_end.



311
312
313
# File 'lib/hookbridge/types.rb', line 311

def cancel_at_period_end
  @cancel_at_period_end
end

#current_period_endObject (readonly)

Returns the value of attribute current_period_end.



311
312
313
# File 'lib/hookbridge/types.rb', line 311

def current_period_end
  @current_period_end
end

#limitsObject (readonly)

Returns the value of attribute limits.



311
312
313
# File 'lib/hookbridge/types.rb', line 311

def limits
  @limits
end

#planObject (readonly)

Returns the value of attribute plan.



311
312
313
# File 'lib/hookbridge/types.rb', line 311

def plan
  @plan
end

#statusObject (readonly)

Returns the value of attribute status.



311
312
313
# File 'lib/hookbridge/types.rb', line 311

def status
  @status
end

#usageObject (readonly)

Returns the value of attribute usage.



311
312
313
# File 'lib/hookbridge/types.rb', line 311

def usage
  @usage
end