Module: Spunk::Helpers
- Defined in:
- lib/spunk/helpers.rb
Class Method Summary collapse
Class Method Details
.hashify(bot, origin, command, msg) ⇒ Object
8 9 10 11 12 |
# File 'lib/spunk/helpers.rb', line 8 def Helpers.hashify(bot, origin, command, msg) hash = {:bot=>bot, :origin=>origin, :command => command, :msg => msg, :room => nil} hash[:room] = Helpers.parse_room(command) return hash end |
.parse_room(command) ⇒ Object
3 4 5 6 |
# File 'lib/spunk/helpers.rb', line 3 def Helpers.parse_room(command) command.match(/(\#\S+\b)/i) return $1 end |