Class: RMonitor::Actions::DSL
- Inherits:
-
Object
- Object
- RMonitor::Actions::DSL
- Defined in:
- lib/rmonitor/actions/dsl.rb
Instance Attribute Summary collapse
-
#actions ⇒ Object
Returns the value of attribute actions.
Instance Method Summary collapse
- #dpi(value) ⇒ Object
-
#initialize ⇒ DSL
constructor
A new instance of DSL.
- #off(name) ⇒ Object
- #on(name, options = {}) ⇒ Object
Constructor Details
#initialize ⇒ DSL
Returns a new instance of DSL.
6 7 8 |
# File 'lib/rmonitor/actions/dsl.rb', line 6 def initialize @actions = [] end |
Instance Attribute Details
#actions ⇒ Object
Returns the value of attribute actions.
4 5 6 |
# File 'lib/rmonitor/actions/dsl.rb', line 4 def actions @actions end |
Instance Method Details
#dpi(value) ⇒ Object
18 19 20 |
# File 'lib/rmonitor/actions/dsl.rb', line 18 def dpi(value) @actions << {:action => :option, :name => :dpi, :value => value} end |
#off(name) ⇒ Object
10 11 12 |
# File 'lib/rmonitor/actions/dsl.rb', line 10 def off(name) @actions << {:action => :off, :name => name} end |
#on(name, options = {}) ⇒ Object
14 15 16 |
# File 'lib/rmonitor/actions/dsl.rb', line 14 def on(name, = {}) @actions << .merge(:action => :on, :name => name) end |