Class: Framecurve::Comment
- Inherits:
-
Object
- Object
- Framecurve::Comment
- Includes:
- Comparable
- Defined in:
- lib/framecurve/comment.rb
Overview
Represents a framecurve comment
Instance Attribute Summary collapse
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
- #<=>(another) ⇒ Object
- #comment? ⇒ Boolean
-
#initialize(text) ⇒ Comment
constructor
A new instance of Comment.
- #to_s ⇒ Object
- #tuple? ⇒ Boolean
Constructor Details
#initialize(text) ⇒ Comment
Returns a new instance of Comment.
6 7 8 |
# File 'lib/framecurve/comment.rb', line 6 def initialize(text) @text = text end |
Instance Attribute Details
#text ⇒ Object (readonly)
Returns the value of attribute text.
4 5 6 |
# File 'lib/framecurve/comment.rb', line 4 def text @text end |
Instance Method Details
#<=>(another) ⇒ Object
22 23 24 |
# File 'lib/framecurve/comment.rb', line 22 def <=>(another) to_s <=> another.to_s end |
#comment? ⇒ Boolean
14 15 16 |
# File 'lib/framecurve/comment.rb', line 14 def comment? true end |
#to_s ⇒ Object
18 19 20 |
# File 'lib/framecurve/comment.rb', line 18 def to_s ['#', text.to_s.gsub(/\r\n?/, '')].join(' ') end |
#tuple? ⇒ Boolean
10 11 12 |
# File 'lib/framecurve/comment.rb', line 10 def tuple? false end |