Class: IniParse::Lines::BlankOption

Inherits:
Object
  • Object
show all
Includes:
Line
Defined in:
lib/tungsten/iniparse.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#keyObject

Returns the value of attribute key.



12
13
14
# File 'lib/tungsten/iniparse.rb', line 12

def key
  @key
end

#valueObject

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