Sha256: e2bcc97865ad88613222ae34399a999a0a9a11313091a43a3354b3960b3f0408

Contents?: true

Size: 480 Bytes

Versions: 1

Compression:

Stored size: 480 Bytes

Contents

require "weeblycloud/cloudresource"

module Weeblycloud

  class Plan < CloudResource

    def initialize(plan_id, data = nil)
      @plan_id = plan_id.to_i
      @endpoint = "plan/#{@plan_id}"
      super(data)
    end

    # Makes an API call to get the resource
    def get
      response = @client.get(@endpoint)
      plan = response.json["plans"]
      @properties = plan[plan.keys.first]
    end

    # Returns the plan_id
    def id
      @plan_id
    end
    
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
weeblycloud-1.0.0 lib/weeblycloud/plan.rb