Module: FFWD::Reporter::ClassMethods
- Defined in:
- lib/ffwd/reporter.rb
Instance Method Summary collapse
- #report_key(key, options = {}) ⇒ Object
-
#report_meta(meta) ⇒ Object
Configure either static or dynamic metadata.
- #reporter_keys ⇒ Object
-
#reporter_meta ⇒ Object
Statically configured metadata.
- #setup_reporter(opts = {}) ⇒ Object
Instance Method Details
#report_key(key, options = {}) ⇒ Object
55 56 57 |
# File 'lib/ffwd/reporter.rb', line 55 def report_key key, ={} reporter_keys << {:key => key, :meta => [:meta] || {}} end |
#report_meta(meta) ⇒ Object
Configure either static or dynamic metadata. If a symbol is provided, it is assumed to be the name of the function that will be used to fetch metadata. If a Hash is provided, it will be assumed to be the static metadata.
47 48 49 50 51 52 53 |
# File 'lib/ffwd/reporter.rb', line 47 def unless .is_a? Hash raise "Invalid meta: #{.inspect}" end @reporter_meta = end |
#reporter_keys ⇒ Object
34 35 36 |
# File 'lib/ffwd/reporter.rb', line 34 def reporter_keys @reporter_keys ||= [] end |
#reporter_meta ⇒ Object
Statically configured metadata.
39 40 41 |
# File 'lib/ffwd/reporter.rb', line 39 def @reporter_meta ||= {} end |
#setup_reporter(opts = {}) ⇒ Object
59 60 61 |
# File 'lib/ffwd/reporter.rb', line 59 def setup_reporter opts={} raise "setup_reporter is deprecated, use (report_*) instead!" end |