Class: BuildStatusServer::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/build_status_server/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

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

#configObject (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(options = {})
  config = load_config_file(options[:config])
  import_config(config, options)
end

#respond_to?(meth) ⇒ Boolean

Returns:

  • (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_fileObject



24
25
26
27
# File 'lib/build_status_server/config.rb', line 24

def store_file
  return File.expand_path(".", store["filename"]) if store
  nil
end