Class: Adapter

Inherits:
Object
  • Object
show all
Includes:
Logging
Defined in:
lib/business/adapter/adapter.rb

Overview

You must implement this class to adapt your data stream in our framework

Direct Known Subclasses

RandomAdapter, TwitterAdapter

Constant Summary

Constants included from Logging

Logging::KermitPFC

Instance Method Summary collapse

Methods included from Logging

#logger, logger

Constructor Details

#initializeAdapter

Initializes the Adapter to run the logger

Raises:

  • (Exception)

    if the method hasn’t been implemented yet



14
15
16
17
18
19
# File 'lib/business/adapter/adapter.rb', line 14

def initialize
	
	logger.fatal('The method initialize in Adapter must be implemented')
	raise 'This method must be implemented'

end

Instance Method Details

#connect_stream(stream = 1) ⇒ Object

Connects to a particular data stream

Parameters:

  • stream (Integer) (defaults to: 1)

    the number of the stream to identify it

Raises:

  • (Exception)

    if the method hasn’t been implemented yet



25
26
27
28
# File 'lib/business/adapter/adapter.rb', line 25

def connect_stream (stream=1)
	logger.fatal('The method connect_stream in Adapter must be implemented')
	raise 'This method must be implemented'
end

#persist(status) ⇒ Object

Persist the status retrieved from the data stream

Parameters:

  • status (String)

    the status retrieved from the data stream

Raises:

  • (Exception)

    if the method hasn’t been implemented yet



34
35
36
37
# File 'lib/business/adapter/adapter.rb', line 34

def persist status
	logger.fatal('The method persist in Adapter must be implemented')
	raise 'This method must be implemented'
end