Class: Urbit::SubscribeMessage

Inherits:
Message
  • Object
show all
Defined in:
lib/urbit/subscribe_message.rb

Instance Attribute Summary collapse

Attributes inherited from Message

#app, #channel, #contents, #id, #mark

Instance Method Summary collapse

Methods inherited from Message

#channel_url, #request_body, #ship, #to_a, #to_s, #transmit

Constructor Details

#initialize(channel:, app:, path:) ⇒ SubscribeMessage

Returns a new instance of SubscribeMessage.



5
6
7
8
# File 'lib/urbit/subscribe_message.rb', line 5

def initialize(channel:, app:, path:)
  super(channel: channel, app: app)
  @path = path
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



3
4
5
# File 'lib/urbit/subscribe_message.rb', line 3

def path
  @path
end

Instance Method Details

#actionObject



10
11
12
# File 'lib/urbit/subscribe_message.rb', line 10

def action
  "subscribe"
end

#to_hObject



14
15
16
# File 'lib/urbit/subscribe_message.rb', line 14

def to_h
  {action: self.action, app: self.app, id: self.id, path: self.path, ship: self.ship.untilded_name}
end