Class: Ruboty::Handlers::Aa

Inherits:
Base
  • Object
show all
Defined in:
lib/ruboty/aa.rb

Instance Method Summary collapse

Instance Method Details

#aa(message) ⇒ Object



26
27
28
29
30
31
# File 'lib/ruboty/aa.rb', line 26

def aa(message)
  word = message.match_data[1]
  if word && !word.empty?
    message.reply prefix + artii.asciify(word).chomp + suffix
  end
end

#artiiObject



22
23
24
# File 'lib/ruboty/aa.rb', line 22

def artii
  @artii ||= Artii::Base.new(font: (ENV['AA_FONT'] || 'big'))
end

#prefixObject



13
14
15
# File 'lib/ruboty/aa.rb', line 13

def prefix
  ENV['AA_PREFIX'] ||= "```\n"
end

#suffixObject



17
18
19
# File 'lib/ruboty/aa.rb', line 17

def suffix
  ENV['AA_SUFFIX'] ||= "\n```"
end