Module: FFWD::Reporter::ClassMethods

Defined in:
lib/ffwd/reporter.rb

Instance Method Summary collapse

Instance Method Details

#report_key(key, options = {}) ⇒ Object



55
56
57
# File 'lib/ffwd/reporter.rb', line 55

def report_key key, options={}
  reporter_keys <<  {:key => key, :meta => options[: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 report_meta meta
  unless meta.is_a? Hash
    raise "Invalid meta: #{meta.inspect}"
  end

  @reporter_meta = meta
end

#reporter_keysObject



34
35
36
# File 'lib/ffwd/reporter.rb', line 34

def reporter_keys
  @reporter_keys ||= []
end

#reporter_metaObject

Statically configured metadata.



39
40
41
# File 'lib/ffwd/reporter.rb', line 39

def reporter_meta
  @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