Class: Lita::Handlers::Bigtext

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

Instance Method Summary collapse

Instance Method Details

#hide_bigtext(message) ⇒ Object



18
19
20
21
22
# File 'lib/lita/handlers/bigtext.rb', line 18

def hide_bigtext(message)
  too_long = longtext
  url_placeholder = snip_text too_long
  message.reply url_placeholder
end

#longtextObject



29
30
31
32
33
# File 'lib/lita/handlers/bigtext.rb', line 29

def longtext
  (1..100).each.map do
    %w[able baker charlie delta echo alpha bravo hawaii].sample
  end.join(' ')
end

#snip_text(text) ⇒ Object



24
25
26
27
# File 'lib/lita/handlers/bigtext.rb', line 24

def snip_text(text)
  Lita::Extensions::ShipToPastebin.new.
    save_to_pastebin(text, api_key: config.pastebin_api_key)
end