Class: Alephant::Logger::JSONtoIO

Inherits:
JSON
  • Object
show all
Defined in:
lib/alephant/logger/json_to_io.rb

Constant Summary

Constants inherited from JSON

Alephant::Logger::JSON::VERSION

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from JSON

session?

Constructor Details

#initialize(output, options = {}) ⇒ JSONtoIO

Returns a new instance of JSONtoIO.



9
10
11
12
13
14
# File 'lib/alephant/logger/json_to_io.rb', line 9

def initialize(output, options = {})
  @output            = output
  @nesting           = options.fetch(:nesting, false)
  @write_level       = options.fetch(:level, :debug)
  self.class.session = -> { 'n/a' } unless self.class.session?
end

Instance Attribute Details

#outputObject (readonly)

Returns the value of attribute output.



7
8
9
# File 'lib/alephant/logger/json_to_io.rb', line 7

def output
  @output
end