class Apolo::Reader
Readers are responsible for gathering data about a something specific that is a part of your system.
Attributes
data[R]
Public Class Methods
new(config)
click to toggle source
@param [Hash, read] config A hash containing any number of
configurations that will be passed to the #setup method
# File lib/apolo/reader.rb, line 9 def initialize(config) @config = config @data = {} setup(config.options) end
Public Instance Methods
execute(*args)
click to toggle source
Called when the Reader
must take action and gather all the data needed to be analyzed.
@raise [NotImplementedError] raised when method is not overriden.
# 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)
click to toggle source
Called when the reader object is being constructed. Arguments can be everything the developer set in the creation of Reader
.
@raise [NotImplementedError] raised when method is not overriden.
# File lib/apolo/reader.rb, line 20 def setup(*args) raise NotImplementedError, 'You must implement the setup method for Reader to work correctly.' end