Class: BotMob::Slack::InboundMessage
- Inherits:
-
InboundMessage
- Object
- InboundMessage
- BotMob::Slack::InboundMessage
- Defined in:
- lib/bot_mob/slack/inbound_message.rb
Instance Attribute Summary collapse
-
#bot_id ⇒ Object
readonly
Returns the value of attribute bot_id.
-
#channel_id ⇒ Object
readonly
Returns the value of attribute channel_id.
-
#channel_name ⇒ Object
readonly
Returns the value of attribute channel_name.
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#external_id ⇒ Object
readonly
Returns the value of attribute external_id.
-
#format ⇒ Object
readonly
Returns the value of attribute format.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#response_url ⇒ Object
readonly
Returns the value of attribute response_url.
-
#team_domain ⇒ Object
readonly
Returns the value of attribute team_domain.
-
#team_id ⇒ Object
readonly
Returns the value of attribute team_id.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
-
#ts ⇒ Object
readonly
Returns the value of attribute ts.
-
#user_name ⇒ Object
readonly
Returns the value of attribute user_name.
Attributes inherited from InboundMessage
Class Method Summary collapse
Instance Method Summary collapse
- #command? ⇒ Boolean
- #human? ⇒ Boolean
-
#initialize(params) ⇒ InboundMessage
constructor
A new instance of InboundMessage.
Methods inherited from InboundMessage
Constructor Details
#initialize(params) ⇒ InboundMessage
Returns a new instance of InboundMessage.
8 9 10 11 12 13 |
# File 'lib/bot_mob/slack/inbound_message.rb', line 8 def initialize(params) @format = params[:format] || :websocket @network = params[:network] @params = params send("parse_#{format}".to_sym, @params) end |
Instance Attribute Details
#bot_id ⇒ Object (readonly)
Returns the value of attribute bot_id.
4 5 6 |
# File 'lib/bot_mob/slack/inbound_message.rb', line 4 def bot_id @bot_id end |
#channel_id ⇒ Object (readonly)
Returns the value of attribute channel_id.
4 5 6 |
# File 'lib/bot_mob/slack/inbound_message.rb', line 4 def channel_id @channel_id end |
#channel_name ⇒ Object (readonly)
Returns the value of attribute channel_name.
4 5 6 |
# File 'lib/bot_mob/slack/inbound_message.rb', line 4 def channel_name @channel_name end |
#command ⇒ Object (readonly)
Returns the value of attribute command.
4 5 6 |
# File 'lib/bot_mob/slack/inbound_message.rb', line 4 def command @command end |
#external_id ⇒ Object (readonly)
Returns the value of attribute external_id.
4 5 6 |
# File 'lib/bot_mob/slack/inbound_message.rb', line 4 def external_id @external_id end |
#format ⇒ Object (readonly)
Returns the value of attribute format.
4 5 6 |
# File 'lib/bot_mob/slack/inbound_message.rb', line 4 def format @format end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
4 5 6 |
# File 'lib/bot_mob/slack/inbound_message.rb', line 4 def params @params end |
#response_url ⇒ Object (readonly)
Returns the value of attribute response_url.
4 5 6 |
# File 'lib/bot_mob/slack/inbound_message.rb', line 4 def response_url @response_url end |
#team_domain ⇒ Object (readonly)
Returns the value of attribute team_domain.
4 5 6 |
# File 'lib/bot_mob/slack/inbound_message.rb', line 4 def team_domain @team_domain end |
#team_id ⇒ Object (readonly)
Returns the value of attribute team_id.
4 5 6 |
# File 'lib/bot_mob/slack/inbound_message.rb', line 4 def team_id @team_id end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
4 5 6 |
# File 'lib/bot_mob/slack/inbound_message.rb', line 4 def token @token end |
#ts ⇒ Object (readonly)
Returns the value of attribute ts.
4 5 6 |
# File 'lib/bot_mob/slack/inbound_message.rb', line 4 def ts @ts end |
#user_name ⇒ Object (readonly)
Returns the value of attribute user_name.
4 5 6 |
# File 'lib/bot_mob/slack/inbound_message.rb', line 4 def user_name @user_name end |
Class Method Details
.parse(params) ⇒ Object
15 16 17 |
# File 'lib/bot_mob/slack/inbound_message.rb', line 15 def self.parse(params) new(params) end |
Instance Method Details
#command? ⇒ Boolean
23 24 25 |
# File 'lib/bot_mob/slack/inbound_message.rb', line 23 def command? !command.nil? end |
#human? ⇒ Boolean
19 20 21 |
# File 'lib/bot_mob/slack/inbound_message.rb', line 19 def human? bot_id.nil? end |