Class: DoroParser::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/dorothy2/DEM.rb

Defined Under Namespace

Classes: IRC, SMTP

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#serviceObject (readonly)

Returns the value of attribute service.



20
21
22
# File 'lib/dorothy2/DEM.rb', line 20

def service
  @service
end

Class Method Details

.guess(a) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/dorothy2/DEM.rb', line 22

def self.guess(a)

  if a =~ /USER |USERHOST |PRIVMSG |PASS |NICK |JOIN |MODE |MSG/
    t = IRC.new a
  elsif a =~ /from(.*)From(.*)Subject/m
    t = SMTP.init a
  elsif a =~ /(\d*)(.*)\n/
    t = SMTP.new a
  else
    t = nil
  end

  return t
end