Class: Fpmache::File
- Inherits:
-
Object
- Object
- Fpmache::File
- Defined in:
- lib/fpmache/file.rb
Overview
Process single INI file and return section contents
Instance Attribute Summary collapse
-
#contents ⇒ Object
Returns the value of attribute contents.
-
#inifile ⇒ Object
Returns the value of attribute inifile.
Instance Method Summary collapse
-
#initialize(inifile) ⇒ File
constructor
A new instance of File.
-
#read ⇒ Object
Public - Read the INI file and return the processed Hash.
Constructor Details
#initialize(inifile) ⇒ File
Returns a new instance of File.
7 8 9 10 |
# File 'lib/fpmache/file.rb', line 7 def initialize(inifile) @inifile = inifile @contents = {} end |
Instance Attribute Details
#contents ⇒ Object
Returns the value of attribute contents.
6 7 8 |
# File 'lib/fpmache/file.rb', line 6 def contents @contents end |
#inifile ⇒ Object
Returns the value of attribute inifile.
6 7 8 |
# File 'lib/fpmache/file.rb', line 6 def inifile @inifile end |
Instance Method Details
#read ⇒ Object
Public - Read the INI file and return the processed Hash. Usually, there would be one section per file for PHP-FPM configuraiton file
Returns Hash
16 17 18 19 20 21 |
# File 'lib/fpmache/file.rb', line 16 def read ini = IniFile.load(@inifile) section = process_sections(ini) ini[section] end |