Class: DaashubAPI::Company

Inherits:
Base
  • Object
show all
Defined in:
lib/daashub_api/company.rb

Class Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from DaashubAPI::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class DaashubAPI::Base

Class Method Details

.from_array(items) ⇒ Object



3
4
5
6
7
8
# File 'lib/daashub_api/company.rb', line 3

def self.from_array(items)
  @companies = items.fetch('items', []).map { |i| new(i) }
  check_for_errors(items)
  add_fields(items['fields'])
  @companies
end