Class: ModSpox::Handlers::Handler

Inherits:
Object
  • Object
show all
Defined in:
lib/mod_spox/handlers/Handler.rb

Instance Method Summary collapse

Constructor Details

#initialize(handlers) ⇒ Handler

handlers

array of handlers

initialize handler and add self to available handlers



11
12
13
# File 'lib/mod_spox/handlers/Handler.rb', line 11

def initialize(handlers)
    raise Exceptions::NotImplemented.new('Method has not been implemented')
end

Instance Method Details

#preprocess(data) ⇒ Object

data

any expected data

Preprocessing allows for actions to be taken while messages are still in a synchronized state



24
25
# File 'lib/mod_spox/handlers/Handler.rb', line 24

def preprocess(data)
end

#process(data) ⇒ Object

data

string of data

Process the string and create the proper object



17
18
19
# File 'lib/mod_spox/handlers/Handler.rb', line 17

def process(data)
    raise Exceptions::NotImplemented.new('Method has not been implemented')
end