Class: Nurego::Organization

Inherits:
APIResource show all
Includes:
APIOperations::List, APIOperations::Update
Defined in:
lib/nurego/organization.rb

Instance Attribute Summary

Attributes inherited from NuregoObject

#api_key

Instance Method Summary collapse

Methods included from APIOperations::Update

#save, #serialize_params

Methods included from APIOperations::List

included

Methods inherited from APIResource

class_name, #refresh, retrieve, 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

Instance Method Details

#billsObject



14
15
16
# File 'lib/nurego/organization.rb', line 14

def bills
  Bill.all({ :organization => id }, @api_key)[:bills]
end

#entitlements(feature_id = nil, external_id = nil) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/nurego/organization.rb', line 18

def entitlements(feature_id = nil, external_id = nil)
  if external_id
    Entitlement.all({:organization => external_id, :feature_id => feature_id }, @api_key)
  else
    Entitlement.all({:organization => id, :feature_id => feature_id, :provider_name => 'internal' }, @api_key)
  end
end

#instancesObject



6
7
8
# File 'lib/nurego/organization.rb', line 6

def instances
  Instance.all({:organization => id }, @api_key)
end

#paymentmethodObject



10
11
12
# File 'lib/nurego/organization.rb', line 10

def paymentmethod
  PaymentMethod.all({:organization => id}, @api_key)
end