Class: RMonitor::Cache
- Inherits:
-
Object
- Object
- RMonitor::Cache
- Defined in:
- lib/rmonitor/cache.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Cache
constructor
A new instance of Cache.
- #invoke(command) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Cache
Returns a new instance of Cache.
3 4 5 6 |
# File 'lib/rmonitor/cache.rb', line 3 def initialize( = {}) @output = {} @invoker = [:invoker] || Invoker.new() end |
Instance Method Details
#invoke(command) ⇒ Object
8 9 10 |
# File 'lib/rmonitor/cache.rb', line 8 def invoke(command) @output[command] ||= @invoker.invoke(command) end |