Class: BuildStatusServer::Config
- Inherits:
-
Object
- Object
- BuildStatusServer::Config
- Defined in:
- lib/build_status_server/config.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
-
#load(options = {}) ⇒ Object
This is responsible of loading the config object.
- #method_missing(meth, *args, &block) ⇒ Object
- #respond_to?(meth) ⇒ Boolean
- #store_file ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
5 6 7 |
# File 'lib/build_status_server/config.rb', line 5 def initialize @config = {} end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, *args, &block) ⇒ Object
15 16 17 18 |
# File 'lib/build_status_server/config.rb', line 15 def method_missing(meth, *args, &block) return config[meth.to_s] if config.has_key?(meth.to_s) super end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
3 4 5 |
# File 'lib/build_status_server/config.rb', line 3 def config @config end |
Instance Method Details
#load(options = {}) ⇒ Object
This is responsible of loading the config object
10 11 12 13 |
# File 'lib/build_status_server/config.rb', line 10 def load( = {}) config = load_config_file([:config]) import_config(config, ) end |
#respond_to?(meth) ⇒ Boolean
20 21 22 |
# File 'lib/build_status_server/config.rb', line 20 def respond_to?(meth) config.has_key?(meth.to_s) || super end |
#store_file ⇒ Object
24 25 26 27 |
# File 'lib/build_status_server/config.rb', line 24 def store_file return File.(".", store["filename"]) if store nil end |