Class: Timetrap::Formatters::Harvest
- Inherits:
-
Object
- Object
- Timetrap::Formatters::Harvest
- Defined in:
- lib/timetrap-harvest.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
writeonly
Sets the attribute client.
-
#config ⇒ Object
writeonly
Sets the attribute config.
-
#entries ⇒ Object
readonly
Returns the value of attribute entries.
Instance Method Summary collapse
-
#initialize(entries) ⇒ Harvest
constructor
A new instance of Harvest.
- #output ⇒ Object
Constructor Details
#initialize(entries) ⇒ Harvest
Returns a new instance of Harvest.
21 22 23 |
# File 'lib/timetrap-harvest.rb', line 21 def initialize(entries) @entries = entries end |
Instance Attribute Details
#client=(value) ⇒ Object
Sets the attribute client
19 20 21 |
# File 'lib/timetrap-harvest.rb', line 19 def client=(value) @client = value end |
#config=(value) ⇒ Object
Sets the attribute config
19 20 21 |
# File 'lib/timetrap-harvest.rb', line 19 def config=(value) @config = value end |
#entries ⇒ Object (readonly)
Returns the value of attribute entries.
18 19 20 |
# File 'lib/timetrap-harvest.rb', line 18 def entries @entries end |
Instance Method Details
#output ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/timetrap-harvest.rb', line 25 def output results = entries.map { |entry| TimetrapHarvest::Formatter.new(entry, config).format } harvester = TimetrapHarvest::Harvester.new(results, client) results = harvester.harvest TimetrapHarvest::Output.new(results).generate end |