class RMonitor::Config::DSL

Attributes

profiles[RW]

Public Class Methods

new() click to toggle source
# File lib/rmonitor/config/dsl.rb, line 8
def initialize
  @profiles = []
end

Public Instance Methods

profile(name, options = {}, &block) click to toggle source
# File lib/rmonitor/config/dsl.rb, line 12
def profile(name, options = {}, &block)
  @profiles << RMonitor::Profile::Builder.define(name, options, &block)

  if @profiles.last.has_key?(:only_if)
    @profiles.last[:only_if] = method(@profiles.last[:only_if])
  end

  if @profiles.last.has_key?(:not_if)
    @profiles.last[:not_if] = method(@profiles.last[:not_if])
  end
end