Class: ClusterBomb::Bomb::Task
- Inherits:
-
Object
- Object
- ClusterBomb::Bomb::Task
- Defined in:
- lib/cluster_bomb/bomb.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#group ⇒ Object
readonly
Returns the value of attribute group.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#proc ⇒ Object
Returns the value of attribute proc.
-
#roles ⇒ Object
Returns the value of attribute roles.
-
#sudo ⇒ Object
Returns the value of attribute sudo.
Instance Method Summary collapse
-
#initialize(name, group, filename = nil, filetime = nil, opts = {}) ⇒ Task
constructor
A new instance of Task.
- #updated? ⇒ Boolean
Constructor Details
#initialize(name, group, filename = nil, filetime = nil, opts = {}) ⇒ Task
Returns a new instance of Task.
19 20 21 22 23 24 25 26 27 |
# File 'lib/cluster_bomb/bomb.rb', line 19 def initialize(name, group, filename=nil, filetime=nil, opts={}) @name=name self.roles=[] @filename=filename @group = group @filetime=filetime @options=opts @sudo = opts[:sudo] end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
16 17 18 |
# File 'lib/cluster_bomb/bomb.rb', line 16 def description @description end |
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
17 18 19 |
# File 'lib/cluster_bomb/bomb.rb', line 17 def filename @filename end |
#group ⇒ Object (readonly)
Returns the value of attribute group.
17 18 19 |
# File 'lib/cluster_bomb/bomb.rb', line 17 def group @group end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
17 18 19 |
# File 'lib/cluster_bomb/bomb.rb', line 17 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
18 19 20 |
# File 'lib/cluster_bomb/bomb.rb', line 18 def @options end |
#proc ⇒ Object
Returns the value of attribute proc.
16 17 18 |
# File 'lib/cluster_bomb/bomb.rb', line 16 def proc @proc end |
#roles ⇒ Object
Returns the value of attribute roles.
16 17 18 |
# File 'lib/cluster_bomb/bomb.rb', line 16 def roles @roles end |
#sudo ⇒ Object
Returns the value of attribute sudo.
16 17 18 |
# File 'lib/cluster_bomb/bomb.rb', line 16 def sudo @sudo end |
Instance Method Details
#updated? ⇒ Boolean
28 29 30 31 |
# File 'lib/cluster_bomb/bomb.rb', line 28 def updated? return false if !self.filename File.stat(self.filename).mtime != @filetime end |