Class: Dialogue::ConversationTemplate
- Inherits:
-
Object
- Object
- Dialogue::ConversationTemplate
- Defined in:
- lib/dialogue/conversation_template.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#template ⇒ Object
readonly
Returns the value of attribute template.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name = nil, &block) ⇒ ConversationTemplate
constructor
A new instance of ConversationTemplate.
- #register ⇒ Object
- #start(message, options = {}) ⇒ Object
Constructor Details
#initialize(name = nil, &block) ⇒ ConversationTemplate
Returns a new instance of ConversationTemplate.
5 6 7 8 |
# File 'lib/dialogue/conversation_template.rb', line 5 def initialize(name=nil, &block) @name = name @template = block end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/dialogue/conversation_template.rb', line 3 def name @name end |
#template ⇒ Object (readonly)
Returns the value of attribute template.
3 4 5 |
# File 'lib/dialogue/conversation_template.rb', line 3 def template @template end |
Class Method Details
.build(name, &block) ⇒ Object
10 11 12 |
# File 'lib/dialogue/conversation_template.rb', line 10 def self.build(name, &block) ConversationTemplate.new name, &block end |
Instance Method Details
#register ⇒ Object
14 15 16 17 |
# File 'lib/dialogue/conversation_template.rb', line 14 def register Dialogue.register_template self self end |
#start(message, options = {}) ⇒ Object
19 20 21 |
# File 'lib/dialogue/conversation_template.rb', line 19 def start(, ={}) ConversationTemplateRunner.new(, ).run self end |