Module: FFWD::Reporter::ClassMethods

Defined in:
lib/ffwd/reporter.rb

Instance Method Summary collapse

Instance Method Details

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



53
54
55
# File 'lib/ffwd/reporter.rb', line 53

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.



45
46
47
48
49
50
51
# File 'lib/ffwd/reporter.rb', line 45

def report_meta meta
  unless meta.is_a? Hash
    raise "Invalid meta: #{meta.inspect}"
  end

  @reporter_meta = meta
end

#reporter_keysObject



32
33
34
# File 'lib/ffwd/reporter.rb', line 32

def reporter_keys
  @reporter_keys ||= []
end

#reporter_metaObject

Statically configured metadata.



37
38
39
# File 'lib/ffwd/reporter.rb', line 37

def reporter_meta
  @reporter_meta ||= {}
end

#setup_reporter(opts = {}) ⇒ Object



57
58
59
# File 'lib/ffwd/reporter.rb', line 57

def setup_reporter opts={}
  raise "setup_reporter is deprecated, use (report_*) instead!"
end