Class: Symian::TraceCollector
- Inherits:
-
Object
- Object
- Symian::TraceCollector
- Extended by:
- Forwardable
- Defined in:
- lib/symian/trace_collector.rb
Constant Summary collapse
- ATTRIBUTES =
attributes to store
[ :incidents, :events, :support_groups ]
- METHODS =
methods to dynamically generate
[ :save_and_close, ATTRIBUTES.collect{ |attr| [ "#{attr}", "record_#{attr}", "with_#{attr}" ] } ].flatten!
Instance Method Summary collapse
-
#initialize(backend, opts = {}) ⇒ TraceCollector
constructor
A new instance of TraceCollector.
Constructor Details
#initialize(backend, opts = {}) ⇒ TraceCollector
Returns a new instance of TraceCollector.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/symian/trace_collector.rb', line 10 def initialize(backend, opts={}) @backend = case backend when :memory MemoryBackend.new when :yaml raise ArgumentError, 'File not specified' unless opts[:file] YAMLBackend.new(opts[:file]) # when :marshal # MarshalBackend.new # when :json # JsonBackend.new else raise ArgumentError, 'Unsupported backend!' end end |