Class: Ptimelog::Command::Base
- Inherits:
-
Object
- Object
- Ptimelog::Command::Base
- Defined in:
- lib/ptimelog/command/base.rb
Overview
Foundation and common API for all commands
Instance Method Summary collapse
- #entries=(_values) ⇒ Object
-
#initialize ⇒ Base
constructor
A new instance of Base.
- #needs_entries? ⇒ Boolean
- #run ⇒ Object
Constructor Details
#initialize ⇒ Base
Returns a new instance of Base.
7 8 9 10 |
# File 'lib/ptimelog/command/base.rb', line 7 def initialize @config = Configuration.instance @entries = {} if needs_entries? end |
Instance Method Details
#entries=(_values) ⇒ Object
20 21 22 |
# File 'lib/ptimelog/command/base.rb', line 20 def entries=(_values) raise 'Implement a entries-writer-method for your command' if needs_entries? end |
#needs_entries? ⇒ Boolean
12 13 14 |
# File 'lib/ptimelog/command/base.rb', line 12 def needs_entries? false end |
#run ⇒ Object
16 17 18 |
# File 'lib/ptimelog/command/base.rb', line 16 def run raise 'Implement a run-method for your command' end |