Class: Settings
- Inherits:
-
Object
- Object
- Settings
- Defined in:
- lib/solrmarc_wrapper/settings.rb
Overview
Read the .yml file containing the configuration values
Instance Attribute Summary collapse
-
#solr_url ⇒ Object
readonly
Returns the value of attribute solr_url.
-
#solrmarc_conf_props_file ⇒ Object
readonly
Returns the value of attribute solrmarc_conf_props_file.
-
#solrmarc_dist_dir ⇒ Object
readonly
Returns the value of attribute solrmarc_dist_dir.
Instance Method Summary collapse
-
#as_hash ⇒ Object
The attributes of this class as a Hash.
-
#initialize(settings_group) ⇒ Settings
constructor
A new instance of Settings.
Constructor Details
#initialize(settings_group) ⇒ Settings
Returns a new instance of Settings.
8 9 10 11 12 13 |
# File 'lib/solrmarc_wrapper/settings.rb', line 8 def initialize(settings_group) yml = YAML.load_file('config/settings.yml')[settings_group] @solrmarc_dist_dir = yml["solrmarc_dist_dir"] @solrmarc_conf_props_file = yml["solrmarc_conf_props_file"] @solr_url = yml["solr_url"] end |
Instance Attribute Details
#solr_url ⇒ Object (readonly)
Returns the value of attribute solr_url.
6 7 8 |
# File 'lib/solrmarc_wrapper/settings.rb', line 6 def solr_url @solr_url end |
#solrmarc_conf_props_file ⇒ Object (readonly)
Returns the value of attribute solrmarc_conf_props_file.
6 7 8 |
# File 'lib/solrmarc_wrapper/settings.rb', line 6 def solrmarc_conf_props_file @solrmarc_conf_props_file end |
#solrmarc_dist_dir ⇒ Object (readonly)
Returns the value of attribute solrmarc_dist_dir.
6 7 8 |
# File 'lib/solrmarc_wrapper/settings.rb', line 6 def solrmarc_dist_dir @solrmarc_dist_dir end |
Instance Method Details
#as_hash ⇒ Object
Returns the attributes of this class as a Hash.
16 17 18 19 20 |
# File 'lib/solrmarc_wrapper/settings.rb', line 16 def as_hash {:solrmarc_dist_dir => @solrmarc_dist_dir, :solrmarc_conf_props_file => @solrmarc_conf_props_file, :solr_url => @solr_url } end |