Class: Conexa::Company

Inherits:
Model show all
Defined in:
lib/conexa/resources/company.rb

Overview

Company resource (Empresa / unidade)

Examples:

List companies

Conexa::Company.all(limit: 50)

Find a company

Conexa::Company.find(3)

Constant Summary

Constants inherited from ConexaObject

Conexa::ConexaObject::RESOURCES

Instance Attribute Summary

Attributes inherited from ConexaObject

#attributes

Class Method Summary collapse

Methods inherited from Model

all, #class_name, class_name, #create, create, #destroy, destroy, extract_page_size_or_params, #fetch, find_by, find_by_id, #id, #primary_key, primary_key_attribute, #primary_key_name, #save, #set_primary_key, underscored_class_name

Methods included from Deprecatable

#deprecate

Methods inherited from ConexaObject

#==, #[]=, convert, #empty?, #initialize, #respond_to_missing?, #to_hash, #unsaved_attributes

Constructor Details

This class inherits a constructor from Conexa::ConexaObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Conexa::ConexaObject

Class Method Details

.show_url(*params) ⇒ Object



21
22
23
# File 'lib/conexa/resources/company.rb', line 21

def show_url(*params)
  ["/company", *params].join '/'
end

.url(*params) ⇒ Object

Model#url pluralizes by appending "s", which yields "/companys" and 404s. Any resource with an irregular English plural has to override this — see spec/contract/api_contract_spec.rb, which checks every resource's URL against the published collection.



17
18
19
# File 'lib/conexa/resources/company.rb', line 17

def url(*params)
  ["/companies", *params].join '/'
end