Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/botemon/string.rb

Overview

– Copyright© 2013 Giovanni Capuano <[email protected]>

This file is part of Botémon.

Botémon is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Botémon is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Botémon. If not, see <www.gnu.org/licenses/>. ++

Instance Method Summary collapse

Instance Method Details

#numeric?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/botemon/string.rb', line 21

def numeric?
  self.to_i.to_s == self || self.to_f.to_s == self
end

#oper?(bot) ⇒ Boolean

Returns:

  • (Boolean)


25
26
27
28
# File 'lib/botemon/string.rb', line 25

def oper?(bot)
  bot.channels.each { |c| return true if c.ops.include? self }
  false
end