Class: Autoini::Comment
- Inherits:
-
AbstractLine
- Object
- Element
- AbstractLine
- Autoini::Comment
- Defined in:
- lib/autoini/comment.rb
Instance Attribute Summary collapse
-
#comment ⇒ Object
Returns the value of attribute comment.
Class Method Summary collapse
Instance Method Summary collapse
- #==(e) ⇒ Object
-
#initialize(comment) ⇒ Comment
constructor
A new instance of Comment.
- #to_a ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(comment) ⇒ Comment
Returns a new instance of Comment.
5 6 7 |
# File 'lib/autoini/comment.rb', line 5 def initialize(comment) @comment = comment end |
Instance Attribute Details
#comment ⇒ Object
Returns the value of attribute comment.
3 4 5 |
# File 'lib/autoini/comment.rb', line 3 def comment @comment end |
Class Method Details
.parse(line) ⇒ Object
25 26 27 |
# File 'lib/autoini/comment.rb', line 25 def self.parse(line) Comment.new(line[1..-1].join.strip) if line[0] == Autoini.comment end |
.parse_with_comment(line) ⇒ Object
21 22 23 |
# File 'lib/autoini/comment.rb', line 21 def self.parse_with_comment(line) parse(line) end |
Instance Method Details
#==(e) ⇒ Object
17 18 19 |
# File 'lib/autoini/comment.rb', line 17 def ==(e) e.is_a?(Comment) && comment == e.comment end |
#to_a ⇒ Object
13 14 15 |
# File 'lib/autoini/comment.rb', line 13 def to_a [] end |