Class: DoroParser::Parser::IRC

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ IRC

Returns a new instance of IRC.



103
104
105
106
107
108
109
110
111
# File 'lib/dorothy2/DEM.rb', line 103

def initialize(data)
  if data =~ /(USER |USERHOST |PRIVMSG |PASS |NICK |JOIN |MODE |MSG )(.*)\n/
    noutf = Iconv.new('US-ASCII//TRANSLIT', 'UTF-8')
    @command = $1
    @content = noutf.iconv($2).gsub(/"|'|\\/, "-")    #xcode bug ->>> ")
  end
  #return true if [email protected]?
  return self
end

Instance Attribute Details

#commandObject (readonly)

Returns the value of attribute command.



99
100
101
# File 'lib/dorothy2/DEM.rb', line 99

def command
  @command
end

#contentObject (readonly)

Returns the value of attribute content.



100
101
102
# File 'lib/dorothy2/DEM.rb', line 100

def content
  @content
end