Class: RMonitor::Commands::Update

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

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Update

Returns a new instance of Update.



4
5
6
7
# File 'lib/rmonitor/commands/update.rb', line 4

def initialize(options = {})
  @invoke = options[:invoke] || Invoke.new(options)
  @selector = options[:selector] || Selector.new(options)
end

Instance Method Details

#executeObject



9
10
11
12
13
14
15
# File 'lib/rmonitor/commands/update.rb', line 9

def execute
  profile = @selector.first_invokable

  raise NoInvokableProfileError unless profile

  @invoke.execute(profile[:name])
end