Class: Herodot::ProjectLink
- Inherits:
-
Object
- Object
- Herodot::ProjectLink
- Defined in:
- lib/herodot/project_link.rb
Constant Summary collapse
- PROJECT_CONFIG =
'.herodot.yml'.freeze
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(worklog) ⇒ ProjectLink
constructor
A new instance of ProjectLink.
- #totals ⇒ Object
Constructor Details
#initialize(worklog) ⇒ ProjectLink
Returns a new instance of ProjectLink.
16 17 18 19 |
# File 'lib/herodot/project_link.rb', line 16 def initialize(worklog) @worklog = worklog @project_configurations = {} end |
Class Method Details
.link(path, link, pattern) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/herodot/project_link.rb', line 9 def self.link(path, link, pattern) puts "Write link into #{project_config_file(path)}" File.open(project_config_file(path), 'w') do |f| YAML.dump({ link: link, pattern: pattern }, f) end end |
.project_config_file(path) ⇒ Object
5 6 7 |
# File 'lib/herodot/project_link.rb', line 5 def self.project_config_file(path) File.join(File.(path), PROJECT_CONFIG) end |
Instance Method Details
#totals ⇒ Object
21 22 23 24 25 |
# File 'lib/herodot/project_link.rb', line 21 def totals @worklog.totals.map do |date, logs| [date, decorated_logs(logs)] end end |