Class: Hector::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/hector/request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(line) ⇒ Request

Returns a new instance of Request.



6
7
8
9
# File 'lib/hector/request.rb', line 6

def initialize(line)
  @line = line
  parse
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



3
4
5
# File 'lib/hector/request.rb', line 3

def args
  @args
end

#commandObject (readonly)

Returns the value of attribute command.



3
4
5
# File 'lib/hector/request.rb', line 3

def command
  @command
end

#lineObject (readonly) Also known as: to_s

Returns the value of attribute line.



3
4
5
# File 'lib/hector/request.rb', line 3

def line
  @line
end

#textObject (readonly)

Returns the value of attribute text.



3
4
5
# File 'lib/hector/request.rb', line 3

def text
  @text
end

Instance Method Details

#event_nameObject



11
12
13
# File 'lib/hector/request.rb', line 11

def event_name
  "on_#{command.downcase}"
end

#sensitive?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/hector/request.rb', line 15

def sensitive?
  command.downcase == "pass"
end