Class: IniReader
- Inherits:
-
Object
- Object
- IniReader
- Defined in:
- lib/ini_reader.rb,
lib/inireader/base.rb,
lib/inireader/version.rb
Constant Summary collapse
- VERSION =
"0.1.2"
Class Method Summary collapse
Instance Method Summary collapse
-
#[](section_name) ⇒ Object
returns the hash for a section of the inifile.
-
#initialize(string = '') ⇒ IniReader
constructor
A new instance of IniReader.
Constructor Details
#initialize(string = '') ⇒ IniReader
Returns a new instance of IniReader.
2 3 4 5 |
# File 'lib/inireader/base.rb', line 2 def initialize( string = '') @section_hash = {} parse(StringIO.new(string)) end |
Class Method Details
Instance Method Details
#[](section_name) ⇒ Object
returns the hash for a section of the inifile
14 15 16 |
# File 'lib/inireader/base.rb', line 14 def []( section_name ) return @section_hash[section_name] end |