Class: IniParse::Lines::BlankOption
- Inherits:
-
Object
- Object
- IniParse::Lines::BlankOption
- Includes:
- Line
- Defined in:
- lib/tungsten/iniparse.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
-
#value ⇒ Object
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(key, value = nil, opts = {}) ⇒ BlankOption
constructor
Parameters key<String>:: The option key.
Methods included from Line
#blank?, #comment, #has_comment?, #to_ini
Constructor Details
#initialize(key, value = nil, opts = {}) ⇒ BlankOption
Parameters
- key<String>
-
The option key.
- value<String>
-
The value for this option.
- opts<Hash>
-
Extra options for the line.
19 20 21 22 |
# File 'lib/tungsten/iniparse.rb', line 19 def initialize(key, value = nil, opts = {}) super(opts) @key, @value = nil, value end |
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
12 13 14 |
# File 'lib/tungsten/iniparse.rb', line 12 def key @key end |
#value ⇒ Object
Returns the value of attribute value.
12 13 14 |
# File 'lib/tungsten/iniparse.rb', line 12 def value @value end |
Class Method Details
.parse(line, opts) ⇒ Object
24 25 26 27 28 |
# File 'lib/tungsten/iniparse.rb', line 24 def self.parse(line, opts) if m = @regex.match(line) [:option, m[1].strip, nil, opts] end end |