Class: Rescuetime::Formatters::BaseFormatter Abstract
- Inherits:
-
Object
- Object
- Rescuetime::Formatters::BaseFormatter
- Defined in:
- lib/rescuetime/formatters/base_formatter.rb
Overview
This class is abstract.
Subclass and override BaseFormatter.name and BaseFormatter.format to implement a custom formatter
Base class for report formatters
Direct Known Subclasses
Class Method Summary collapse
-
.descendents ⇒ Array<Class>
Returns all classes descended from the current class.
-
.format(_report) ⇒ Object
Formats the rescuetime report from CSV to a user-defined format.
-
.name ⇒ String
Returns the name of your formatter.
Class Method Details
.descendents ⇒ Array<Class>
Returns all classes descended from the current class
42 43 44 |
# File 'lib/rescuetime/formatters/base_formatter.rb', line 42 def self.descendents ObjectSpace.each_object(Class).select { |klass| klass < self } end |
.format(_report) ⇒ Object
Formats the rescuetime report from CSV to a user-defined format
27 28 29 30 |
# File 'lib/rescuetime/formatters/base_formatter.rb', line 27 def self.format(_report) raise NotImplementedError, 'you have not defined report formatting instructions' end |
.name ⇒ String
Returns the name of your formatter
17 18 19 |
# File 'lib/rescuetime/formatters/base_formatter.rb', line 17 def self.name raise NotImplementedError, 'you have not defined a report name' end |