Class: Urbit::AckMessage
Instance Attribute Summary collapse
-
#ack_id ⇒ Object
readonly
Returns the value of attribute ack_id.
Attributes inherited from Message
#app, #channel, #contents, #id, #mark
Instance Method Summary collapse
- #action ⇒ Object
-
#initialize(channel:, sse_message_id:) ⇒ AckMessage
constructor
A new instance of AckMessage.
- #to_h ⇒ Object
- #to_s ⇒ Object
Methods inherited from Message
#channel_url, #request_body, #ship, #to_a, #transmit
Constructor Details
#initialize(channel:, sse_message_id:) ⇒ AckMessage
Returns a new instance of AckMessage.
5 6 7 8 |
# File 'lib/urbit/ack_message.rb', line 5 def initialize(channel:, sse_message_id:) super(channel: channel) @ack_id = end |
Instance Attribute Details
#ack_id ⇒ Object (readonly)
Returns the value of attribute ack_id.
3 4 5 |
# File 'lib/urbit/ack_message.rb', line 3 def ack_id @ack_id end |
Instance Method Details
#action ⇒ Object
10 11 12 |
# File 'lib/urbit/ack_message.rb', line 10 def action "ack" end |
#to_h ⇒ Object
14 15 16 17 |
# File 'lib/urbit/ack_message.rb', line 14 def to_h # Need to use the older hash style due to the key having a dash. {'id' => self.id, 'action' => self.action, 'event-id' => self.ack_id} end |
#to_s ⇒ Object
19 20 21 |
# File 'lib/urbit/ack_message.rb', line 19 def to_s "an AckMessage(#{self.to_h})" end |