Class: Kounta::Company
- Defined in:
- lib/kounta/company.rb
Instance Attribute Summary
Attributes inherited from Resource
Instance Method Summary collapse
- #base_price_list ⇒ Object
-
#initialize(client, hash = {}) ⇒ Company
constructor
A new instance of Company.
- #resource_path ⇒ Object
Methods inherited from Resource
coerce, #delete!, has_many, has_many_in_time_range, has_one, #ignored_properties, #new?, #save!, #to_hash
Constructor Details
#initialize(client, hash = {}) ⇒ Company
Returns a new instance of Company.
48 49 50 51 52 53 54 55 56 57 |
# File 'lib/kounta/company.rb', line 48 def initialize(client, hash = {}) @client = client if hash.empty? response = client.perform({ companies: 'me' }, :get).parsed super(response) else super(hash) end end |
Instance Method Details
#base_price_list ⇒ Object
59 60 61 |
# File 'lib/kounta/company.rb', line 59 def base_price_list client.object_from_response(Kounta::PriceList, :get, companies: id, price_lists: 'base') end |
#resource_path ⇒ Object
63 64 65 |
# File 'lib/kounta/company.rb', line 63 def resource_path { companies: id } end |