class Twib::Response

A response from either twibd or a remote device.

Attributes

device_id[R]
object_id[R]
object_ids[R]
payload[R]
result_code[R]
tag[R]

Public Class Methods

new(device_id, object_id, result_code, tag, payload, object_ids) click to toggle source

@param device_id [Integer] ID of the device that this response originated from. @param object_id [Integer] ID of the bridge object that this response originated from. @param result_code [Integer] Result code @param tag [Integer] Tag corresponding to the request that prompted this response. @param payload [String] Raw data associated with the response @param object_ids [Array<Integer>] Object IDs sent with the response

# File lib/twib.rb, line 31
def initialize(device_id, object_id, result_code, tag, payload, object_ids)
  @device_id = device_id
  @object_id = object_id
  @result_code = result_code
  @tag = tag
  @payload = payload
  @object_ids = object_ids
end

Public Instance Methods

assert_ok() click to toggle source

Raises a {ResultError} if the {#result_code} is not OK. @raise [ResultError] @return [self]

# File lib/twib.rb, line 45
def assert_ok
  if @result_code != 0 then
    raise ResultError.new(@result_code)
  end
  return self
end