lib/neo4j/config.rb in neo4j-1.0.0.beta.17 vs lib/neo4j/config.rb in neo4j-1.0.0.beta.18
- old
+ new
@@ -1,12 +1,15 @@
module Neo4j
- # Keeps configuration for neo4j.
+ # == Keeps configuration for neo4j.
#
- # Neo4j::Config[:storage_path]:: is used for locating the neo4j database on the filesystem.
+ # The most important configuration is <tt>Neo4j::Config[:storage_path]</tt> which is used to
+ # locate where the neo4j database is stored on the filesystem.
+ # If this directory is empty then a new database will be created, otherwise it will use the
+ # database from that directory.
#
class Config
# This code is copied from merb-core/config.rb.
class << self
# Returns the hash of default config values for neo4j
@@ -43,22 +46,22 @@
# Set the value of a config entry.
#
# ==== Parameters
- # key<Object>:: The key to set the parameter for.
- # val<Object>:: The value of the parameter.
+ # key:: The key to set the parameter for.
+ # val:: The value of the parameter.
#
def []=(key, val)
(@configuration ||= setup)[key] = val
end
# Gets the the value of a config entry
#
# ==== Parameters
- # key<Object>:: The key of the config entry value we want
+ # key:: The key of the config entry value we want
#
def [](key)
(@configuration ||= setup)[key]
end
@@ -67,11 +70,11 @@
#
# ==== Parameters
# key<Object>:: The key of the parameter to delete.
#
# ==== Returns
- # Object:: The value of the removed entry.
+ # The value of the removed entry.
#
def delete(key)
@configuration.delete(key)
end
@@ -88,16 +91,15 @@
# Retrieve the value of a config entry, returning the provided default if the key is not present
#
# ==== Parameters
- # key<Object>:: The key to retrieve the parameter for.
- # default<Object>::
- # The default value to return if the parameter is not set.
+ # key:: The key to retrieve the parameter for.
+ # default::The default value to return if the parameter is not set.
#
# ==== Returns
- # Object:: The value of the configuration parameter or the default.
+ # The value of the configuration parameter or the default.
#
def fetch(key, default)
@configuration.fetch(key, default)
end
@@ -114,19 +116,19 @@
# Returns the configuration as a hash.
#
# ==== Returns
- # Hash:: The config as a hash.
+ # The config as a hash.
#
def to_hash
@configuration
end
# Returns the config as YAML.
#
# ==== Returns
- # String:: The config as YAML.
+ # The config as YAML.
#
def to_yaml
require "yaml"
@configuration.to_yaml
end
\ No newline at end of file