Class: Schatter::Command::CreateConversation

Inherits:
Object
  • Object
show all
Defined in:
lib/schatter/command/create_conversation.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#helpObject (readonly)

Returns the value of attribute help.



4
5
6
# File 'lib/schatter/command/create_conversation.rb', line 4

def help
  @help
end

#sessionObject (readonly)

Returns the value of attribute session.



4
5
6
# File 'lib/schatter/command/create_conversation.rb', line 4

def session
  @session
end

#usageObject (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