Module: SirTracksAlot::Reports::Report::Helpers
- Included in:
- ActivityReport::Helpers, ActorActivityReport::Helpers, ActorReport::Helpers, BasicReport::Helpers, FilterReport::Helpers, SirTracksAlot::Reports::RootStemReport::Helpers, SimpleReport::Helpers, TargetReport::Helpers
- Defined in:
- lib/sir_tracks_alot/reports/report.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.handle(name, &block) ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/sir_tracks_alot/reports/report.rb', line 27 def self.handle(name, &block) @@handlers ||= {} name = [name] unless name.kind_of?(Array) name.each do |n| @@handlers[n] = block end end |
Instance Method Details
#render_data(name, value) ⇒ Object
40 41 42 43 44 |
# File 'lib/sir_tracks_alot/reports/report.rb', line 40 def render_data(name, value) @@handlers ||= {} return value if !@@handlers.include?(name) @@handlers[name].call(value) end |
#to_dom_class(words) ⇒ Object
36 37 38 |
# File 'lib/sir_tracks_alot/reports/report.rb', line 36 def to_dom_class(words) (words||'').gsub(/[^a-z0-9]/, '_') end |