Class: Rho::RhoConfig

Inherits:
Object show all
Defined in:
lib/rho/rho.rb

Overview

Generic configuration class which accepts hashes with unique keys

Constant Summary collapse

@@sources =
{}
@@config =
{'start_path' => '/app', 
'options_path' => '/app/Settings'}

Class Method Summary collapse

Class Method Details

.add_source(modelname, new_source = nil) ⇒ Object



233
234
235
236
237
238
239
# File 'lib/rho/rho.rb', line 233

def add_source(modelname, new_source=nil)
  if new_source
    unless @@sources[new_source]
      @@sources[modelname] = new_source
    end
  end
end

.configObject



229
230
231
# File 'lib/rho/rho.rb', line 229

def config
  @@config
end

.method_missing(name, *args) ⇒ Object



220
221
222
223
# File 'lib/rho/rho.rb', line 220

def method_missing(name, *args)
  varname = name.to_s.sub(/=/,'')
  @@config[varname]
end

.sourcesObject



225
226
227
# File 'lib/rho/rho.rb', line 225

def sources
  @@sources
end