Class: RTM::Rails::Configuration
- Inherits:
-
Object
- Object
- RTM::Rails::Configuration
- Defined in:
- lib/rtm/rails.rb
Instance Attribute Summary collapse
-
#connections ⇒ Object
The connection configuration for the current environment as collected from the configuration files.
-
#topicmaps ⇒ Object
The topicmaps configuration for the current environment as collected from the configuration files.
-
#topicmaps_configuration_file ⇒ Object
The path to the topicmaps configuration file to use.
Instance Method Summary collapse
- #default_topicmaps_configuration_file ⇒ Object
-
#initialize ⇒ Configuration
constructor
Create a new Configuration instance, initialized with the default values.
-
#topicmaps_configuration ⇒ Object
Loads and returns the contents of the #database_configuration_file.
Constructor Details
#initialize ⇒ Configuration
Create a new Configuration instance, initialized with the default values.
51 52 53 |
# File 'lib/rtm/rails.rb', line 51 def initialize self.topicmaps_configuration_file = default_topicmaps_configuration_file end |
Instance Attribute Details
#connections ⇒ Object
The connection configuration for the current environment as collected from the configuration files.
43 44 45 |
# File 'lib/rtm/rails.rb', line 43 def connections @connections end |
#topicmaps ⇒ Object
The topicmaps configuration for the current environment as collected from the configuration files.
47 48 49 |
# File 'lib/rtm/rails.rb', line 47 def topicmaps @topicmaps end |
#topicmaps_configuration_file ⇒ Object
The path to the topicmaps configuration file to use. (Defaults to config/topicmaps.yml
.)
39 40 41 |
# File 'lib/rtm/rails.rb', line 39 def topicmaps_configuration_file @topicmaps_configuration_file end |
Instance Method Details
#default_topicmaps_configuration_file ⇒ Object
64 65 66 |
# File 'lib/rtm/rails.rb', line 64 def default_topicmaps_configuration_file File.join(::Rails.root, 'config', 'topicmaps.yml') end |
#topicmaps_configuration ⇒ Object
Loads and returns the contents of the #database_configuration_file. The contents of the file are processed via ERB before being sent through YAML::load.
59 60 61 62 |
# File 'lib/rtm/rails.rb', line 59 def topicmaps_configuration require 'erb' YAML::load(ERB.new(::IO.read(topicmaps_configuration_file)).result) end |