class Ruboty::Ume::Actions::Umec

Umec

Public Instance Methods

call() click to toggle source
# File lib/ruboty/ume/actions/umec.rb, line 11
def call
  message.reply(umec)
end

Private Instance Methods

normalize_text(text) click to toggle source
# File lib/ruboty/ume/actions/umec.rb, line 25
def normalize_text(text)
  return DEFAULT_TEXT if text.nil?
  return DEFAULT_TEXT if text.empty?
  return DEFAULT_TEXT unless text.is_a?(String)
  text
end
umec() click to toggle source
# File lib/ruboty/ume/actions/umec.rb, line 17
def umec
  repeat_count = Ruboty::Ume::Actions.normalize_count(message[:count])
  text = normalize_text(message[:text])
  "#{text}\n" * repeat_count
rescue => e
  e.message
end