Class: Weeblycloud::Plan
- Inherits:
-
CloudResource
- Object
- CloudResource
- Weeblycloud::Plan
- Defined in:
- lib/weeblycloud/plan.rb
Instance Attribute Summary
Attributes inherited from CloudResource
Instance Method Summary collapse
-
#get ⇒ Object
Makes an API call to get the resource.
-
#id ⇒ Object
Returns the plan_id.
-
#initialize(plan_id, data = nil) ⇒ Plan
constructor
A new instance of Plan.
Methods inherited from CloudResource
Constructor Details
#initialize(plan_id, data = nil) ⇒ Plan
Returns a new instance of Plan.
7 8 9 10 11 |
# File 'lib/weeblycloud/plan.rb', line 7 def initialize(plan_id, data = nil) @plan_id = plan_id.to_i @endpoint = "plan/#{@plan_id}" super(data) end |
Instance Method Details
#get ⇒ Object
Makes an API call to get the resource
14 15 16 17 18 |
# File 'lib/weeblycloud/plan.rb', line 14 def get response = @client.get(@endpoint) plan = response.json["plans"] @properties = plan[plan.keys.first] end |
#id ⇒ Object
Returns the plan_id
21 22 23 |
# File 'lib/weeblycloud/plan.rb', line 21 def id @plan_id end |