Class: Timetrap::Formatters::Json
- Inherits:
-
Object
- Object
- Timetrap::Formatters::Json
- Defined in:
- lib/timetrap/formatters/json.rb
Instance Attribute Summary collapse
-
#output ⇒ Object
Returns the value of attribute output.
Instance Method Summary collapse
-
#initialize(entries) ⇒ Json
constructor
A new instance of Json.
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
#output ⇒ Object
Returns the value of attribute output.
14 15 16 |
# File 'lib/timetrap/formatters/json.rb', line 14 def output @output end |