module Confuse::Source

Public Class Methods

create(options = {}) click to toggle source
# File lib/confuse/source.rb, line 10
def create(options = {})
  path = options[:path]

  type = if path
           path[path.rindex('.') + 1, path.length].to_sym
         end
  type ||= options[:type]

  if type
    types[type].new(options)
  else
    Env.new(options)
  end
end
register(type, klass) click to toggle source
# File lib/confuse/source.rb, line 25
def register(type, klass)
  types[type] = klass
end
types() click to toggle source
# File lib/confuse/source.rb, line 6
def types
  @types ||= { }
end