class Eye::Patch::Application

Public Class Methods

new(settings) click to toggle source
Calls superclass method
# File lib/eye/patch/application.rb, line 10
def initialize(settings)
  super()
  @settings = settings
  self[settings[:name]] = parse
end

Private Instance Methods

checks() click to toggle source
# File lib/eye/patch/application.rb, line 48
def checks
  OptionSet.new(Eye::Checker, @settings[:checks])
end
notifications() click to toggle source
# File lib/eye/patch/application.rb, line 38
def notifications
  Array(@settings[:notifications]).each_with_object({}) do |notify, monitors|
    monitors[notify[:name]] = notify[:level].to_sym
  end
end
parse() click to toggle source
# File lib/eye/patch/application.rb, line 18
def parse
  parse_configuration
  parse_processes

  @config
end
parse_configuration() click to toggle source
# File lib/eye/patch/application.rb, line 25
def parse_configuration
  @config = @settings.fetch(:application, {}).merge(
    name: @settings[:name],
    notify: notifications,
    triggers: triggers,
    checks: checks,
  )
end
parse_processes() click to toggle source
# File lib/eye/patch/application.rb, line 34
def parse_processes
  @config[:groups] = GroupSet.new(@config, @settings[:processes])
end
triggers() click to toggle source
# File lib/eye/patch/application.rb, line 44
def triggers
  OptionSet.new(Eye::Trigger, @settings[:triggers])
end