class Weeblycloud::Plan

Public Class Methods

new(plan_id, data = nil) click to toggle source
Calls superclass method Weeblycloud::CloudResource::new
# 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

Public Instance Methods

get() click to toggle source

Makes an API call to get the resource

# File lib/weeblycloud/plan.rb, line 14
def get
  response = @client.get(@endpoint)
  plan = response.json["plans"]
  @properties = plan[plan.keys.first]
end
id() click to toggle source

Returns the plan_id

# File lib/weeblycloud/plan.rb, line 21
def id
  @plan_id
end