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.
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_list ⇒ Object
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_path ⇒ Object
50 51 52 |
# File 'lib/kounta/company.rb', line 50 def resource_path {companies: id} end |