Class: Timetrap::Formatters::Json

Inherits:
Object
  • Object
show all
Defined in:
lib/timetrap/formatters/json.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(entries) ⇒ Json

Returns a new instance of Json.



16
17
18
19
20
21
# File 'lib/timetrap/formatters/json.rb', line 16

def initialize entries
  @output = entries.map do |e|
    next unless e.end
    e.values
  end.compact.to_json
end

Instance Attribute Details

#outputObject

Returns the value of attribute output.



14
15
16
# File 'lib/timetrap/formatters/json.rb', line 14

def output
  @output
end