Class: Tracee::IndifferentStream

Inherits:
Stream
  • Object
show all
Defined in:
lib/tracee/stream.rb

Defined Under Namespace

Classes: TargetError

Instance Attribute Summary

Attributes inherited from Stream

#target

Instance Method Summary collapse

Methods inherited from Stream

#write

Constructor Details

#initialize(target) ⇒ IndifferentStream

@ target : IO | String | {<level name> => < level log file path | IO >, … } | => < level log file path pattern > pattern example : “log/development.%level.log”



80
81
82
83
84
85
86
87
88
89
90
# File 'lib/tracee/stream.rb', line 80

def initialize(target)
  if target.is_a? Hash
    raise TargetError if target.values.any? {|val| !val.respond_to? :<<}
    
    target = target.with_indifferent_access
  else
    raise TargetError unless target.respond_to? :<<
  end

  @target = target
end