Class: NotifyMe::Log::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/notifyme/log.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Base

Returns a new instance of Base.



7
8
9
10
# File 'lib/notifyme/log.rb', line 7

def initialize(args)
  @logger = args.first.to_s.downcase
  @parameters = args.last
end

Class Method Details

.defaultObject



21
22
23
24
# File 'lib/notifyme/log.rb', line 21

def self.default
  require 'notifyme/log/stdout.rb'
  NotifyMe::Log::Stdout.new 
end

Instance Method Details

#loggerObject



12
13
14
15
16
17
18
19
# File 'lib/notifyme/log.rb', line 12

def logger
  begin
    require "notifyme/log/#{@logger}.rb"
  rescue Exception => e
    raise "The #{@logger} is invalid."
  end
  NotifyMe::Log.const_get(@logger.capitalize).new @parameters
end