class Syncano::Packets::CallResponse

Class representing call response packets used in communication with the Sync Server

Attributes

data[RW]
message_id[RW]
result[RW]

Public Class Methods

new(attributes) click to toggle source

Constructor for Syncano::Packets::CallResponse object @param [Hash] attributes

Calls superclass method Syncano::Packets::Base::new
# File lib/syncano/packets/call_response.rb, line 9
def initialize(attributes)
  super(attributes)
  self.message_id = attributes[:message_id]
  self.data = attributes[:data]
  self.result = attributes[:result]
end

Public Instance Methods

call_response?() click to toggle source

Returns true if is a call response packet @return [TrueClass, FalseClass]

# File lib/syncano/packets/call_response.rb, line 24
def call_response?
  true
end
to_response() click to toggle source

Prepares hash in response format @return [Hash]

# File lib/syncano/packets/call_response.rb, line 18
def to_response
  data.merge(result: result)
end