Class: AppConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/appswarm/app_config.rb

Instance Method Summary collapse

Constructor Details

#initializeAppConfig

Returns a new instance of AppConfig.



2
3
4
5
6
7
8
9
10
11
12
13
# File 'lib/appswarm/app_config.rb', line 2

def initialize()
@values={}
  file=File.open("config.properties","r")
  file.each_line{|line|
    line.gsub!(/#.*/,"")
    k,v=line.split("=")
    if k and v
      @values[k]=v
    end
  }
  file.close
end

Instance Method Details

#[](name) ⇒ Object



15
16
17
# File 'lib/appswarm/app_config.rb', line 15

def [](name)
  @values[name]
end