Class: Loki::Task::Base
- Inherits:
-
Object
- Object
- Loki::Task::Base
- Defined in:
- lib/loki/task/base.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #done? ⇒ Boolean
-
#initialize(name) ⇒ Base
constructor
A new instance of Base.
- #list(&block) ⇒ Object
- #sham? ⇒ Boolean
- #time ⇒ Object
- #work(&block) ⇒ Object
Constructor Details
#initialize(name) ⇒ Base
Returns a new instance of Base.
7 8 9 10 |
# File 'lib/loki/task/base.rb', line 7 def initialize(name) @name = name @parent = nil end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/loki/task/base.rb', line 4 def name @name end |
Instance Method Details
#done? ⇒ Boolean
26 27 28 |
# File 'lib/loki/task/base.rb', line 26 def done? false end |
#list(&block) ⇒ Object
36 37 38 39 40 41 42 43 |
# File 'lib/loki/task/base.rb', line 36 def list(&block) Loki.logger.line Loki.logger.puts "#{self.class}: #{@name}, done: #{done?}, time: #{time}", "-" Loki.logger.push yield if block_given? Loki.logger.pull Loki.logger.line end |
#sham? ⇒ Boolean
31 32 33 |
# File 'lib/loki/task/base.rb', line 31 def sham? false end |
#time ⇒ Object
21 22 23 |
# File 'lib/loki/task/base.rb', line 21 def time Time.now end |