Class: Apolo::Reader
- Inherits:
-
Object
- Object
- Apolo::Reader
- Defined in:
- lib/apolo/reader.rb
Overview
Readers are responsible for gathering data about a something specific that is a part of your system.
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#execute(*args) ⇒ Object
Called when the Reader must take action and gather all the data needed to be analyzed.
-
#initialize(config) ⇒ Reader
constructor
A new instance of Reader.
-
#setup(*args) ⇒ Object
Called when the reader object is being constructed.
Constructor Details
#initialize(config) ⇒ Reader
Returns a new instance of Reader.
9 10 11 12 13 14 |
# File 'lib/apolo/reader.rb', line 9 def initialize(config) @config = config @data = {} setup(config.) end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
5 6 7 |
# File 'lib/apolo/reader.rb', line 5 def data @data end |
Instance Method Details
#execute(*args) ⇒ Object
Called when the Reader must take action and gather all the data needed to be analyzed.
28 29 30 |
# File 'lib/apolo/reader.rb', line 28 def execute(*args) raise NotImplementedError, 'You must implement the execute method for Reader to work correctly.' end |
#setup(*args) ⇒ Object
Called when the reader object is being constructed. Arguments can be everything the developer set in the creation of Reader.
20 21 22 |
# File 'lib/apolo/reader.rb', line 20 def setup(*args) raise NotImplementedError, 'You must implement the setup method for Reader to work correctly.' end |