Module: Configuration::ClassMethods

### Home Classes Methods

### In Files

- lib/configuration.rb

### Methods

- #for
- #load
- #path
- #path=

### Class/Module Index

Quicksearch

- Configuration
- Configuration::ClassMethods
- Configuration::DSL
- Configuration::InstanceMethods
- Configuration::Pure
- Object

No matching classes.

# Configuration::ClassMethods

### Public Instance Methods

for(name, options = nil, &block) click to toggle source

    # File lib/configuration.rb, line 21
    def for name, options = nil, &block
      name = name.to_s
      options = options.to_hash if options.is_a?( Configuration )

      if Table.has_key?(name)
        if options or block
          configuration = Table[name]
          Table[name] = DSL.evaluate(configuration, options || {}, &block)
        else
          Table[name]
        end
      else
        if options or block
          Table[name] = new name, options || {}, &block
        else
          load name
        end
      end
    end

load(name) click to toggle source

    # File lib/configuration.rb, line 51
    def load name
      name = name.to_s
      name = name + '.rb' unless name[/\.rb$/]
      key = name.sub /\.rb$/, ''
      load_path = $LOAD_PATH.dup
      begin
        $LOAD_PATH.replace(path + load_path)
        ::Kernel.load name
      ensure
        $LOAD_PATH.replace load_path
      end
      Table[key]
    end

path(*value) click to toggle source

    # File lib/configuration.rb, line 41
    def path *value
      return self.path = value.first unless value.empty?
      Path
    end

path=(value) click to toggle source

    # File lib/configuration.rb, line 46
    def path= value
      Path.clear
      Path.replace [value].compact.flatten.join(File::PATH_SEPARATOR).split(File::PATH_SEPARATOR)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.