Class: JsonTail::Service

Inherits:
Object
  • Object
show all
Defined in:
lib/json_tail/service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, options = {}) ⇒ Service

Returns a new instance of Service.



5
6
7
8
# File 'lib/json_tail/service.rb', line 5

def initialize(name, options = {})
  @name = name
  @options = options
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/json_tail/service.rb', line 3

def name
  @name
end

#optionsObject (readonly)

Returns the value of attribute options.



3
4
5
# File 'lib/json_tail/service.rb', line 3

def options
  @options
end

Instance Method Details

#startObject



10
11
12
13
14
15
# File 'lib/json_tail/service.rb', line 10

def start
  loop do 
    JsonTail::Parser::registry[@options['parser']].build_report(@options)
    sleep(@options['interval'])
  end
end