Class: Settings

Inherits:
Object
  • Object
show all
Defined in:
lib/solrmarc_wrapper/settings.rb

Overview

Read the .yml file containing the configuration values

Instance Attribute Summary collapse

Instance Method Summary collapse

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_urlObject (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_fileObject (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_dirObject (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_hashObject

Returns the attributes of this class as a Hash.

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