Parent

Methods

Class/Module Index [+]

Quicksearch

Webgen::Configuration

Stores the configuration for a webgen website.

Configuration options should be created like this:

config.my.new.config 'value', :doc => 'some', :meta => 'info'

and later accessed or set using the accessor methods #[] and #[]= or a configuration helper. These helpers are defined in the Helpers module and provide easier access to complex configuration options. Also see the webgen manual for information about the configuration helpers.

Attributes

data[R]

The configuration options hash.

meta_info[R]

The hash which stores the meta info for the configuration options.

Public Class Methods

new() click to toggle source

Create a new Configuration object.

# File lib/webgen/configuration.rb, line 121
def initialize
  @data = {}
  @meta_info = {}
end

Public Instance Methods

[](name) click to toggle source

Return the configuration option name.

# File lib/webgen/configuration.rb, line 127
def [](name)
  if @data.has_key?(name)
    @data[name]
  else
    raise ArgumentError, "No such configuration option: #{name}"
  end
end
[]=(name, value) click to toggle source

Set the configuration option name to the provided value.

# File lib/webgen/configuration.rb, line 136
def []=(name, value)
  if @data.has_key?(name)
    @data[name] = value
  else
    raise ArgumentError, "No such configuration option: #{name}"
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.