Class: Syncano::Packets::CallResponse
- Defined in:
- lib/syncano/packets/call_response.rb
Overview
Class representing call response packets used in communication with the Sync Server
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#message_id ⇒ Object
readonly
Returns the value of attribute message_id.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Attributes inherited from Base
Instance Method Summary collapse
-
#call_response? ⇒ TrueClass, FalseClass
Returns true if is a call response packet.
-
#initialize(attributes) ⇒ CallResponse
constructor
Constructor for Syncano::Packets::CallResponse object.
-
#to_response ⇒ Hash
Prepares hash in response format.
Methods inherited from Base
#auth?, instantize_packet, #message?, #notification?, #ping?
Constructor Details
#initialize(attributes) ⇒ CallResponse
Constructor for Syncano::Packets::CallResponse object
9 10 11 12 13 14 |
# File 'lib/syncano/packets/call_response.rb', line 9 def initialize(attributes) super(attributes) self. = attributes[:message_id] self.data = attributes[:data] self.result = attributes[:result] end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
5 6 7 |
# File 'lib/syncano/packets/call_response.rb', line 5 def data @data end |
#message_id ⇒ Object
Returns the value of attribute message_id.
5 6 7 |
# File 'lib/syncano/packets/call_response.rb', line 5 def @message_id end |
#result ⇒ Object
Returns the value of attribute result.
5 6 7 |
# File 'lib/syncano/packets/call_response.rb', line 5 def result @result end |
Instance Method Details
#call_response? ⇒ TrueClass, FalseClass
Returns true if is a call response packet
24 25 26 |
# File 'lib/syncano/packets/call_response.rb', line 24 def call_response? true end |
#to_response ⇒ Hash
Prepares hash in response format
18 19 20 |
# File 'lib/syncano/packets/call_response.rb', line 18 def to_response data.merge(result: result) end |