Class: Rescuetime::Formatters::ArrayFormatter

Inherits:
BaseFormatter show all
Defined in:
lib/rescuetime/formatters/array_formatter.rb

Overview

Formats a rescuetime report as an array of hashes.

Since:

  • v0.4.0

Class Method Summary collapse

Methods inherited from BaseFormatter

descendents

Class Method Details

.format(report) ⇒ Array<Hash>

Formats the rescuetime report from CSV to a user-defined format

Parameters:

  • report (#to_a)

    a csv-formatted report

Returns:

  • (Array<Hash>)

    a report formatted as an array of hashes

Since:

  • v0.4.0



19
20
21
# File 'lib/rescuetime/formatters/array_formatter.rb', line 19

def self.format(report)
  report.to_a.map(&:to_hash)
end

.nameString

Returns the name of your formatter

Returns:

  • (String)

    a name for your report formatter (“array”)

Since:

  • v0.4.0



11
12
13
# File 'lib/rescuetime/formatters/array_formatter.rb', line 11

def self.name
  'array'
end