Class: Nurego::Offering

Inherits:
APIResource show all
Defined in:
lib/nurego/offering.rb

Instance Attribute Summary

Attributes inherited from NuregoObject

#api_key

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from APIResource

class_name, #refresh, url, #url

Methods inherited from NuregoObject

#[], #[]=, #as_json, construct_from, #each, #initialize, #inspect, #keys, #refresh_from, #to_hash, #to_json, #to_s, #values

Constructor Details

This class inherits a constructor from Nurego::NuregoObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Nurego::NuregoObject

Class Method Details

.current(params = {}, api_key = nil) ⇒ Object



8
9
10
11
# File 'lib/nurego/offering.rb', line 8

def self.current(params = {}, api_key = nil)
  response, api_key = Nurego.request(:get, self.url, api_key, params)
  Util.convert_to_nurego_object(response, api_key)
end

.retrieve(id, api_key = nil) ⇒ Object

Raises:

  • (NotImplementedError)


4
5
6
# File 'lib/nurego/offering.rb', line 4

def self.retrieve(id, api_key=nil)
  raise NotImplementedError.new("Offering cannot be retrieved with ID. Retrieve an offering using Offering.current")
end

Instance Method Details

#plansObject



13
14
15
# File 'lib/nurego/offering.rb', line 13

def plans
  Plan.all({:offering => id }, @api_key)
end