class IniParse::Lines::Comment
Represents a comment. Comment
lines begin with a semi-colon or hash.
; this is a comment # also a comment
Public Instance Methods
comment()
click to toggle source
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.
Calls superclass method
IniParse::Lines::Line#comment
# File lib/iniparse/lines.rb, line 348 def comment @comment !~ /\S/ ? @comment_sep : super end
has_comment?()
click to toggle source
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.
# File lib/iniparse/lines.rb, line 338 def has_comment? true end