Class: RMonitor::Commands::CL::Invoke

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

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Invoke

Returns a new instance of Invoke.



7
8
9
10
# File 'lib/rmonitor/commands/cl/invoke.rb', line 7

def initialize(options = {})
  @err = options[:err] || $stderr
  @invoke = options[:invoke] || RMonitor::Commands::Invoke.new(options)
end

Instance Method Details

#execute(name) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/rmonitor/commands/cl/invoke.rb', line 12

def execute(name)
  @invoke.execute(name)
rescue RMonitor::UnknownProfileError
  @err.puts "unknown profile"
rescue RMonitor::UninvokableProfileError
  @err.puts "profile is not invokable"
end