Class: Yell::Adapters::File

Inherits:
Io
  • Object
show all
Defined in:
lib/yell/adapters/file.rb

Overview

The File adapter is the most basic. As one would expect, it’s used for logging into files.

Direct Known Subclasses

Datefile

Constant Summary

Constants inherited from Io

Io::Colors

Instance Method Summary collapse

Methods inherited from Io

#colorize!, #colorize?, #format, #write

Methods included from Base

#close, #level, #write, #write?

Constructor Details

#initialize(options = {}, &block) ⇒ File

Returns a new instance of File.



10
11
12
13
14
# File 'lib/yell/adapters/file.rb', line 10

def initialize( options = {}, &block )
  super( nil, options, &block )

  @filename = options.fetch(:filename, default_filename)
end

Instance Method Details

#Lazily(openthefilehandle) ⇒ Object



17
18
19
# File 'lib/yell/adapters/file.rb', line 17

def stream
  @stream ||= ::File.open( @filename, ::File::WRONLY|::File::APPEND|::File::CREAT )
end