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 Attribute Summary

Attributes inherited from Io

#format

Attributes inherited from Base

#level, #options

Instance Method Summary collapse

Methods inherited from Io

#close, #colorize

Methods inherited from Base

#close, #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

  @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