Class: Schatter::Command::CreateConversation
- Inherits:
-
Object
- Object
- Schatter::Command::CreateConversation
- Defined in:
- lib/schatter/command/create_conversation.rb
Instance Attribute Summary collapse
-
#help ⇒ Object
readonly
Returns the value of attribute help.
-
#session ⇒ Object
readonly
Returns the value of attribute session.
-
#usage ⇒ Object
readonly
Returns the value of attribute usage.
Instance Method Summary collapse
- #execute(name) ⇒ Object
-
#initialize(session) ⇒ CreateConversation
constructor
A new instance of CreateConversation.
Constructor Details
#initialize(session) ⇒ CreateConversation
Returns a new instance of CreateConversation.
6 7 8 9 10 |
# File 'lib/schatter/command/create_conversation.rb', line 6 def initialize session @session = session @usage = '<name>' @help = 'Creates and joins a new conversation' end |
Instance Attribute Details
#help ⇒ Object (readonly)
Returns the value of attribute help.
4 5 6 |
# File 'lib/schatter/command/create_conversation.rb', line 4 def help @help end |
#session ⇒ Object (readonly)
Returns the value of attribute session.
4 5 6 |
# File 'lib/schatter/command/create_conversation.rb', line 4 def session @session end |
#usage ⇒ Object (readonly)
Returns the value of attribute usage.
4 5 6 |
# File 'lib/schatter/command/create_conversation.rb', line 4 def usage @usage end |
Instance Method Details
#execute(name) ⇒ Object
12 13 14 15 |
# File 'lib/schatter/command/create_conversation.rb', line 12 def execute name conversation = session.create_conversation name Schatter::ConversationContext.new(conversation).push end |