Class: Hallmonitor::Outputter

Inherits:
Object
  • Object
show all
Defined in:
lib/hallmonitor/outputter.rb

Overview

An Outputter is an object that can process Events

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Outputter

Initializes a new Outputter outputter

Parameters:

  • name (Object)

    Probably a string or symbol, the name of this



9
10
11
12
# File 'lib/hallmonitor/outputter.rb', line 9

def initialize(name)
  fail(ArgumentError, 'Outputter expects a name') if name.nil?
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/hallmonitor/outputter.rb', line 4

def name
  @name
end

Instance Method Details

#process(event) ⇒ Object

Processes an event. Child classes should implement this to output events

Parameters:

  • event (Event)

    the event to process



16
17
18
# File 'lib/hallmonitor/outputter.rb', line 16

def process(event)
  # Nothing
end