class Unleashed::CompanyResource

The Companies resource allows Companies to be listed. An individual Company details can be viewed by appending its identifier (a GUID formatted as XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX) to the URI. Here are some example URIs: /Companies - returns a list of Company related information.

@see apidocs.unleashedsoftware.com/Companies

Public Instance Methods

all() click to toggle source

Lists all information for your company /Companies - returns a list of Company related information.

@return [Array<Unleashed::Company>] Lists all information for your company.

# File lib/unleashed/resources/company_resource.rb, line 17
def all
  endpoint = 'Companies'
  response = JSON.parse(@client.get(endpoint).body)
  companies = response.key?('Items') ? response['Items'] : []
  companies.map { |attributes| Unleashed::Company.new(@client, attributes) }
end
first() click to toggle source

Get a first company in all

@return [Unleashed::Company]

# File lib/unleashed/resources/company_resource.rb, line 27
def first
  all.first
end
last() click to toggle source

Get a last company in all

@return [Unleashed::Company]

# File lib/unleashed/resources/company_resource.rb, line 34
def last
  all.last
end
model() click to toggle source
# File lib/unleashed/resources/company_resource.rb, line 9
def model
  Unleashed::Company
end