Class: CtdDocumentation::SensorsController

Inherits:
BaseController show all
Defined in:
lib/ctd_documentation/controllers/sensors_controller.rb

Overview

SensorsController

Constant Summary

Constants inherited from BaseController

BaseController::GLOBAL_ERRORS

Instance Attribute Summary

Attributes inherited from BaseController

#config, #http_call_back

Instance Method Summary collapse

Methods inherited from BaseController

#initialize, #new_api_call_builder, #new_parameter, #new_request_builder, #new_response_handler, user_agent

Constructor Details

This class inherits a constructor from CtdDocumentation::BaseController

Instance Method Details

#get_sensors(site_id) ⇒ RangerSystemCheckResponse

Get Sensors

Parameters:

  • site_id (Integer)

    Required parameter: Example:

Returns:



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/ctd_documentation/controllers/sensors_controller.rb', line 12

def get_sensors(site_id)
  new_api_call_builder
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/ranger/system/check',
                                 Server::DEFAULT)
               .query_param(new_parameter(site_id, key: 'site_id'))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('global')))
    .response(new_response_handler
               .deserializer(APIHelper.method(:custom_type_deserializer))
               .deserialize_into(RangerSystemCheckResponse.method(:from_hash)))
    .execute
end