Module: Configuration::InstanceMethods

### Home Classes Methods

### In Files

- lib/configuration.rb

### Methods

- ::new
- #dup
- #each
- #method_missing
- #to_hash
- #update

### Included Modules

- Enumerable

### Class/Module Index

Quicksearch

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

No matching classes.

# Configuration::InstanceMethods

### Attributes

name[R]

### Public Class Methods

new(*argv, &block) click to toggle source

    # File lib/configuration.rb, line 66
    def initialize *argv, &block
      options = Hash === argv.last ? argv.pop : Hash.new
      @name = argv.shift
      DSL.evaluate(self, options, &block)
    end

### Public Instance Methods

dup() click to toggle source

    # File lib/configuration.rb, line 94
    def dup
      ret = self.class.new @name
      each do |name|
        val = __send__ name.to_sym
        if Configuration === val
          val = val.dup
          val.instance_variable_set('@__parent', ret)
          DSL.evaluate(ret, name.to_sym => val)
        else
          DSL.evaluate(ret, name.to_sym => (val.dup rescue val))
        end
      end
      ret
    end

each() click to toggle source

    # File lib/configuration.rb, line 79
    def each
      methods(false).each{|v| yield v }
    end

method_missing(m, *a, &b) click to toggle source

    # File lib/configuration.rb, line 72
    def method_missing m, *a, &b
      return(Pure[@__parent].send m, *a, &b) rescue super if @__parent
      super
    end

to_hash() click to toggle source

    # File lib/configuration.rb, line 83
    def to_hash
      inject({}){ |h,name|
        val = __send__(name.to_sym)
        h.update name.to_sym => Configuration === val ? val.to_hash : val
      }
    end

update(options = {}) click to toggle source

    # File lib/configuration.rb, line 90
    def update options = {}, &block
      DSL.evaluate(self, options, &block)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.