Class: Kounta::Company
- Defined in:
- lib/kounta/company.rb
Instance Method Summary collapse
- #base_price_list ⇒ Object
-
#initialize(hash = {}) ⇒ Company
constructor
A new instance of Company.
- #resource_path ⇒ Object
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.
39 40 41 42 43 44 45 46 |
# File 'lib/kounta/company.rb', line 39 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_list ⇒ Object
48 49 50 |
# File 'lib/kounta/company.rb', line 48 def base_price_list client.object_from_response(Kounta::PriceList, :get, {companies: id, price_lists: 'base'}) end |
#resource_path ⇒ Object
52 53 54 |
# File 'lib/kounta/company.rb', line 52 def resource_path {companies: id} end |