Class: Ptimelog::Command::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/ptimelog/command/base.rb

Overview

Foundation and common API for all commands

Direct Known Subclasses

Edit, Show, Upload

Instance Method Summary collapse

Constructor Details

#initializeBase

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

Returns:

  • (Boolean)


12
13
14
# File 'lib/ptimelog/command/base.rb', line 12

def needs_entries?
  false
end

#runObject



16
17
18
# File 'lib/ptimelog/command/base.rb', line 16

def run
  raise 'Implement a run-method for your command'
end