Class: IniParse::Lines::Comment
Overview
Represents a comment. Comment lines begin with a semi-colon or hash.
; this is a comment
# also a comment
Instance Method Summary collapse
-
#comment ⇒ Object
Returns the inline comment for this line.
-
#has_comment? ⇒ Boolean
Returns if this line has an inline comment.
Methods inherited from Blank
Methods included from Line
#blank?, #initialize, #line_contents, #options, #to_ini
Instance Method Details
#comment ⇒ Object
Returns the inline comment for this line. Includes the comment separator at the beginning of the string.
In rare cases where a comment seperator appeared in the original file, but without a comment, just the seperator will be returned.
348 349 350 |
# File 'lib/iniparse/lines.rb', line 348 def comment @comment !~ /\S/ ? @comment_sep : super end |
#has_comment? ⇒ Boolean
Returns if this line has an inline comment.
Being a Comment this will always return true, even if the comment is nil. This would be the case if the line starts with a comment seperator, but has no comment text. See spec/fixtures/smb.ini for a real-world example.
338 339 340 |
# File 'lib/iniparse/lines.rb', line 338 def has_comment? true end |