Class: Slack::WebsocketOutgoingMessage

Inherits:
Object
  • Object
show all
Defined in:
lib/edi/slack/websocket_outgoing_message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, text:, channel:) ⇒ WebsocketOutgoingMessage

Returns a new instance of WebsocketOutgoingMessage.



5
6
7
8
9
10
# File 'lib/edi/slack/websocket_outgoing_message.rb', line 5

def initialize(id: ,text:, channel:)
  @text = text
  @channel = channel
  @type = "message"
  @id = id
end

Instance Attribute Details

#channelObject

Returns the value of attribute channel.



4
5
6
# File 'lib/edi/slack/websocket_outgoing_message.rb', line 4

def channel
  @channel
end

#idObject

Returns the value of attribute id.



4
5
6
# File 'lib/edi/slack/websocket_outgoing_message.rb', line 4

def id
  @id
end

#textObject

Returns the value of attribute text.



4
5
6
# File 'lib/edi/slack/websocket_outgoing_message.rb', line 4

def text
  @text
end

#typeObject

Returns the value of attribute type.



4
5
6
# File 'lib/edi/slack/websocket_outgoing_message.rb', line 4

def type
  @type
end

Instance Method Details

#to_jsonObject



12
13
14
15
16
17
18
19
# File 'lib/edi/slack/websocket_outgoing_message.rb', line 12

def to_json
  {
    text: text,
    channel: channel,
    type: type,
    id: id
  }.to_json
end