Class: IniParse::Lines::Blank

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

Overview

Represents a blank line. Used so that we can preserve blank lines when writing back to the file.

Direct Known Subclasses

Comment

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Line

#comment, #has_comment?, #initialize, #line_contents, #options, #to_ini

Class Method Details

.parse(line, opts) ⇒ Object



314
315
316
317
318
319
320
321
322
# File 'lib/iniparse/lines.rb', line 314

def self.parse(line, opts)
  if line !~ /\S/ # blank
    if opts[:comment].nil?
      [:blank]
    else
      [:comment, opts[:comment], opts]
    end
  end
end

Instance Method Details

#blank?Boolean

Returns:

  • (Boolean)


310
311
312
# File 'lib/iniparse/lines.rb', line 310

def blank?
  true
end