Class: IniParse::Lines::AnonymousSection

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

Overview

Stores options which appear at the beginning of a file, without a preceding section.

Instance Attribute Summary

Attributes inherited from Section

#key, #lines

Instance Method Summary collapse

Methods inherited from Section

#[], #[]=, #delete, #each, #has_option?, #merge!, #option, parse

Methods included from Line

#blank?, #comment, #has_comment?

Constructor Details

#initializeAnonymousSection

Returns a new instance of AnonymousSection.



208
209
210
# File 'lib/iniparse/lines.rb', line 208

def initialize
  super('__anonymous__')
end

Instance Method Details

#to_iniObject



212
213
214
215
216
# File 'lib/iniparse/lines.rb', line 212

def to_ini
  # Remove the leading space which is added by joining the blank line
  # content with the options.
  super.gsub(/\A\n/, '')
end