Class: Rundock::Operation::Base
Direct Known Subclasses
Constant Summary collapse
- OperationNotImplementedError =
Class.new(NotImplementedError)
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#instruction ⇒ Object
readonly
Returns the value of attribute instruction.
Instance Method Summary collapse
-
#initialize(instruction, attributes) ⇒ Base
constructor
A new instance of Base.
- #logging(message, severity) ⇒ Object
- #run(backend, attributes = {}) ⇒ Object
Constructor Details
#initialize(instruction, attributes) ⇒ Base
Returns a new instance of Base.
9 10 11 12 13 |
# File 'lib/rundock/operation/base.rb', line 9 def initialize(instruction, attributes) @instruction = instruction @attributes = attributes @attributes = {} unless attributes end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
7 8 9 |
# File 'lib/rundock/operation/base.rb', line 7 def attributes @attributes end |
#instruction ⇒ Object (readonly)
Returns the value of attribute instruction.
6 7 8 |
# File 'lib/rundock/operation/base.rb', line 6 def instruction @instruction end |
Instance Method Details
#logging(message, severity) ⇒ Object
19 20 21 22 23 |
# File 'lib/rundock/operation/base.rb', line 19 def logging(, severity) h_host = @attributes[:nodename].just(' ', 15) h_ope = "start #{self.class.to_s.split('::').last.downcase}:" Logger.send(severity.to_sym, "#{h_host} #{h_ope} #{message}") end |
#run(backend, attributes = {}) ⇒ Object
15 16 17 |
# File 'lib/rundock/operation/base.rb', line 15 def run(backend, attributes = {}) raise OperationNotImplementedError end |