class Schatter::Command::ListConversations

Attributes

help[R]
session[R]
usage[R]

Public Class Methods

new(session) click to toggle source
# File lib/schatter/command/list_conversations.rb, line 10
def initialize session
  @session = session
  @usage = ''
  @help = 'Lists current conversations'
end

Public Instance Methods

description(conversation, index) click to toggle source
# File lib/schatter/command/list_conversations.rb, line 22
def description conversation, index
  [
    c(to_index(index), :yellow),
    c(conversation.formatted_timestamp, :blue),
    c(conversation.name, :magenta),
  ].join ' '
end
execute(ignored) click to toggle source
# File lib/schatter/command/list_conversations.rb, line 16
def execute ignored
  session.conversations(true).values.each_with_index do |conversation, index|
    puts description conversation, index
  end
end