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?, #options

Constructor Details

#initializeAnonymousSection

Returns a new instance of AnonymousSection.



226
227
228
# File 'lib/iniparse/lines.rb', line 226

def initialize
  super('__anonymous__')
end

Instance Method Details

#to_iniObject



230
231
232
233
234
# File 'lib/iniparse/lines.rb', line 230

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