Class: Lita::Handlers::InspirebotTestSelly

Inherits:
Handler
  • Object
show all
Defined in:
lib/lita/handlers/inspirebot_test_selly.rb

Instance Method Summary collapse

Instance Method Details

#authors(response) ⇒ Object



97
98
99
100
101
# File 'lib/lita/handlers/inspirebot_test_selly.rb', line 97

def authors(response)
  @quotes = ::InspirebotTestSelly::Quotes.new
  authors = @quotes.authors_string.upcase
  response.reply "I know about the following authors: #{authors}. To hear quotes, type QUOTE {AUTHOR}"
end


114
115
116
117
# File 'lib/lita/handlers/inspirebot_test_selly.rb', line 114

def menu(response)
  help = 'use QUOTE AUTHORS to get a list of authors. use QUOTE {AUTHOR} to get a random quote from the author'
  response.reply @quotes.get_quote(help)
end

#quote(response) ⇒ Object



103
104
105
106
107
108
109
110
111
112
# File 'lib/lita/handlers/inspirebot_test_selly.rb', line 103

def quote(response)
  @quotes = ::InspirebotTestSelly::Quotes.new
  author = response.match_data[1].downcase
  if author.downcase == 'authors'
    authors = @quotes.authors_string.upcase
    response.reply "I know about the following authors: #{authors}. To hear quotes, type QUOTE {AUTHOR}"
  else
    response.reply @quotes.get_quote(author)
  end
end