Class: RMonitor::Selector

Inherits:
Object
  • Object
show all
Defined in:
lib/rmonitor/selector.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Selector

Returns a new instance of Selector.



3
4
5
6
# File 'lib/rmonitor/selector.rb', line 3

def initialize(options = {})
  @profiles = options[:profiles] || Config.new.profiles
  @matcher = options[:matcher] || Matcher.new(options)
end

Instance Method Details

#first_invokableObject



8
9
10
11
12
# File 'lib/rmonitor/selector.rb', line 8

def first_invokable
  @profiles.find do |profile|
    @matcher.invokable? profile
  end
end