Class: Kounta::Company

Inherits:
Resource
  • Object
show all
Defined in:
lib/kounta/company.rb

Instance Method Summary collapse

Methods inherited from Resource

#client, coerce, has_many, has_one, #ignored_properties, #new?, #save!, #to_hash

Constructor Details

#initialize(hash = {}) ⇒ Company

Returns a new instance of Company.



37
38
39
40
41
42
43
44
# File 'lib/kounta/company.rb', line 37

def initialize(hash={})
	if hash.empty?
		response = client.perform({:companies => "me"}, :get).parsed
		super(response)
	else
		super(hash)
	end
end

Instance Method Details

#base_price_listObject



46
47
48
# File 'lib/kounta/company.rb', line 46

def base_price_list
	client.object_from_response(Kounta::PriceList, :get, {companies: id, price_lists: 'base'})
end

#resource_pathObject



50
51
52
# File 'lib/kounta/company.rb', line 50

def resource_path
	{companies: id}
end