Sha256: 924fc252aad4354ecab544eb534327f899f649d33c9355e264a43adaaf139da3

Contents?: true

Size: 561 Bytes

Versions: 11

Compression:

Stored size: 561 Bytes

Contents

module Toy
  module Connection
    def logger
      @@logger ||= init_default_logger
    end

    def logger=(logger)
      @@logger = logger
    end

    def key_factory=(key_factory)
      @@key_factory = key_factory
    end

    def key_factory
      @@key_factory ||= Toy::Identity::UUIDKeyFactory.new
    end

    def init_default_logger
      if Object.const_defined?("RAILS_DEFAULT_LOGGER")
        @@logger = Object.const_get("RAILS_DEFAULT_LOGGER")
      else
        require 'logger'
        @@logger = ::Logger.new(STDOUT)
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
toystore-0.8.1 lib/toy/connection.rb
toystore-0.8.0 lib/toy/connection.rb
toystore-0.7.0 lib/toy/connection.rb
toystore-0.6.6 lib/toy/connection.rb
toystore-0.6.5 lib/toy/connection.rb
toystore-0.6.4 lib/toy/connection.rb
toystore-0.6.3 lib/toy/connection.rb
toystore-0.6.2 lib/toy/connection.rb
toystore-0.6.1 lib/toy/connection.rb
toystore-0.6 lib/toy/connection.rb
toystore-0.5 lib/toy/connection.rb