Class: InvisibleCollector::Resources::CompanyResource
- Inherits:
-
Object
- Object
- InvisibleCollector::Resources::CompanyResource
show all
- Includes:
- DefaultHandlers
- Defined in:
- lib/invisible_collector/resources/company_resource.rb
Instance Method Summary
collapse
#execute, #execute_get, #execute_post, #handle, #handles
Constructor Details
Returns a new instance of CompanyResource.
8
9
10
|
# File 'lib/invisible_collector/resources/company_resource.rb', line 8
def initialize(options = {})
super(options)
end
|
Instance Method Details
#disable_notifications ⇒ Object
29
30
31
|
# File 'lib/invisible_collector/resources/company_resource.rb', line 29
def disable_notifications
build_response(@connection.put('/companies/disableNotifications'))
end
|
#enable_notifications ⇒ Object
25
26
27
|
# File 'lib/invisible_collector/resources/company_resource.rb', line 25
def enable_notifications
build_response(@connection.put('/companies/enableNotifications'))
end
|
#get ⇒ Object
12
13
14
15
16
17
18
19
|
# File 'lib/invisible_collector/resources/company_resource.rb', line 12
def get
response = @connection.get('companies')
if handles.key? response.status
handles[response.status].call response
else
build_response(response)
end
end
|
#update(company) ⇒ Object
21
22
23
|
# File 'lib/invisible_collector/resources/company_resource.rb', line 21
def update(company)
build_response(@connection.put('companies', company))
end
|