Class: Threatinator::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/threatinator/parser.rb

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Parser

Returns a new instance of Parser.

Parameters:

  • opts (Hash) (defaults to: {})

    An options hash. See subclasses for details.



4
5
# File 'lib/threatinator/parser.rb', line 4

def initialize(opts = {})
end

Instance Method Details

#==(other) ⇒ Object



13
14
15
# File 'lib/threatinator/parser.rb', line 13

def ==(other)
  true
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
20
# File 'lib/threatinator/parser.rb', line 17

def eql?(other)
  self.class == other.class &&
    self == other
end

#run(io) ⇒ Object

Runs the parser against the provided io, yielding records.

Parameters:

  • io (IO)

    The IO to be parsed.

Raises:

  • (NotImplementedError)


9
10
11
# File 'lib/threatinator/parser.rb', line 9

def run(io)
  raise NotImplementedError.new("#{self.class}#run not implemented!")
end