Class: AtreaControl::Duplex::Request
- Inherits:
-
Object
- Object
- AtreaControl::Duplex::Request
- Includes:
- Logger
- Defined in:
- lib/atrea_control/duplex/request.rb
Overview
Process request with duplex unit itself. Handle response
Instance Method Summary collapse
- #call(params) ⇒ Object
-
#initialize(user_id:, unit_id:, sid:) ⇒ Request
constructor
A new instance of Request.
Methods included from Logger
Constructor Details
#initialize(user_id:, unit_id:, sid:) ⇒ Request
Note:
‘ver` is done by atrea server
Returns a new instance of Request.
15 16 17 18 19 20 21 22 |
# File 'lib/atrea_control/duplex/request.rb', line 15 def initialize(user_id:, unit_id:, sid:) @params = { _user: user_id.to_i, _unit: unit_id, auth: sid, ver: AtreaControl::Duplex::CONTROL_VERSION, } end |
Instance Method Details
#call(params) ⇒ Object
26 27 28 |
# File 'lib/atrea_control/duplex/request.rb', line 26 def call(params) RestClient.get "#{AtreaControl::Duplex::CONTROL_URI}/comm/sw/unit.php", params: @params.merge(params) end |