class Turnstile::Configuration

Public Class Methods

from_file(file = nil) click to toggle source
# File lib/turnstile/configuration.rb, line 40
def from_file(file = nil)
  return unless file
  require(normalize(file))
rescue Exception => e
  raise ConfigFileError.new("Error reading configuration from a file #{file}: #{e.message}")
end

Private Class Methods

normalize(file) click to toggle source
# File lib/turnstile/configuration.rb, line 49
def normalize(file)
  file.start_with?('/') ? file : Dir.pwd + '/' + file
end

Public Instance Methods

configure() { |self| ... } click to toggle source
# File lib/turnstile/configuration.rb, line 34
def configure
  yield self if block_given?
  self
end
method_missing(method, *args, &block) click to toggle source
Calls superclass method
# File lib/turnstile/configuration.rb, line 54
def method_missing(method, *args, &block)
  return super unless method.to_s =~ /^redis_/
  prop = method.to_s.gsub(/^redis_/, '').to_sym
  if self.redis.respond_to?(prop)
    prop.to_s.end_with?('=') ? self.redis.send(prop, *args, &block) : self.redis.send(prop)
  end
end