Class: ConfigPlus::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/config_plus/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



11
12
13
14
15
16
17
18
19
# File 'lib/config_plus/config.rb', line 11

def initialize
  @version = VERSION
  @config_method = :config
  @extension = nil
  @loader_logic = :default
  @namespace = nil
  @root_dir = nil
  @source = nil
end

Instance Attribute Details

#config_methodObject

Returns the value of attribute config_method.



3
4
5
# File 'lib/config_plus/config.rb', line 3

def config_method
  @config_method
end

#extensionObject

Returns the value of attribute extension.



3
4
5
# File 'lib/config_plus/config.rb', line 3

def extension
  @extension
end

#loader_logicObject



25
26
27
28
29
30
31
32
33
# File 'lib/config_plus/config.rb', line 25

def loader_logic
  return @loader_logic if @loader_logic.is_a?(Class)

  name = ::ConfigPlus::Helper.classify(@loader_logic.to_s)
  name = "#{name}LoaderLogic"
  raise "Unknown loader logic named `#{name}'" unless
    ::ConfigPlus::const_defined?(name)
  ::ConfigPlus::const_get(name)
end

#namespaceObject

Returns the value of attribute namespace.



3
4
5
# File 'lib/config_plus/config.rb', line 3

def namespace
  @namespace
end

#root_dirObject

Returns the value of attribute root_dir.



3
4
5
# File 'lib/config_plus/config.rb', line 3

def root_dir
  @root_dir
end

#sourceObject

Returns the value of attribute source.



3
4
5
# File 'lib/config_plus/config.rb', line 3

def source
  @source
end

#versionObject (readonly)

Returns the value of attribute version.



8
9
10
# File 'lib/config_plus/config.rb', line 8

def version
  @version
end

Instance Method Details

#loaderObject



21
22
23
# File 'lib/config_plus/config.rb', line 21

def loader
  Loader.new(self)
end