Class: Tempo::Views::Reporter
- Inherits:
-
Object
- Object
- Tempo::Views::Reporter
- Defined in:
- lib/tempo/views/reporter.rb
Class Attribute Summary collapse
-
.view_records ⇒ Object
Returns the value of attribute view_records.
Class Method Summary collapse
- .add_format(*formats) ⇒ Object
- .add_options(options) ⇒ Object
- .add_view_record(record) ⇒ Object
- .formats ⇒ Object
- .options ⇒ Object
- .report ⇒ Object
Class Attribute Details
.view_records ⇒ Object
Returns the value of attribute view_records.
28 29 30 |
# File 'lib/tempo/views/reporter.rb', line 28 def view_records @view_records end |
Class Method Details
.add_format(*formats) ⇒ Object
30 31 32 33 |
# File 'lib/tempo/views/reporter.rb', line 30 def add_format(*formats) @@formats ||= [] formats.each {|format| @@formats << format} end |
.add_options(options) ⇒ Object
43 44 45 46 |
# File 'lib/tempo/views/reporter.rb', line 43 def () ||= {} .merge! end |
.add_view_record(record) ⇒ Object
48 49 50 51 52 53 54 55 56 |
# File 'lib/tempo/views/reporter.rb', line 48 def add_view_record(record) @@view_records ||= [] if /Views::ViewRecords/.match record.class.name @@view_records << record else raise InvalidViewRecordError end end |
.formats ⇒ Object
35 36 37 |
# File 'lib/tempo/views/reporter.rb', line 35 def formats @@formats ||= [] end |
.options ⇒ Object
39 40 41 |
# File 'lib/tempo/views/reporter.rb', line 39 def ||= {} end |
.report ⇒ Object
62 63 64 65 66 |
# File 'lib/tempo/views/reporter.rb', line 62 def report # TODO send records to added formatters screen_formatter = Formatters::Screen.new screen_formatter.format_records view_records, end |