Class: Dialogue::ConversationTemplateRunner
- Inherits:
-
Object
- Object
- Dialogue::ConversationTemplateRunner
show all
- Includes:
- ConversationOptions
- Defined in:
- lib/dialogue/conversation_template_runner.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
#method_missing
Constructor Details
Returns a new instance of ConversationTemplateRunner.
7
8
9
10
11
12
|
# File 'lib/dialogue/conversation_template_runner.rb', line 7
def initialize(message, options={})
guard_options! options
@message = message
@options = options
end
|
Instance Attribute Details
#message ⇒ Object
Returns the value of attribute message.
5
6
7
|
# File 'lib/dialogue/conversation_template_runner.rb', line 5
def message
@message
end
|
#options ⇒ Object
Returns the value of attribute options.
5
6
7
|
# File 'lib/dialogue/conversation_template_runner.rb', line 5
def options
@options
end
|
Instance Method Details
#channel_id ⇒ Object
14
15
16
|
# File 'lib/dialogue/conversation_template_runner.rb', line 14
def channel_id
decorated_message.channel_id
end
|
#decorated_message ⇒ Object
18
19
20
|
# File 'lib/dialogue/conversation_template_runner.rb', line 18
def decorated_message
@decorated_message ||= MessageDecorators::Slack.new(message)
end
|
#message_from_author? ⇒ Boolean
22
23
24
|
# File 'lib/dialogue/conversation_template_runner.rb', line 22
def message_from_author?
user_id == options[:author_id]
end
|
#user_id ⇒ Object
40
41
42
|
# File 'lib/dialogue/conversation_template_runner.rb', line 40
def user_id
decorated_message.user_id
end
|