Class: Framecurve::Comment

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/framecurve/comment.rb

Overview

Represents a framecurve comment

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#textObject (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

Returns:

  • (Boolean)


14
15
16
# File 'lib/framecurve/comment.rb', line 14

def comment?
  true
end

#to_sObject



18
19
20
# File 'lib/framecurve/comment.rb', line 18

def to_s
  ['#', text.to_s.gsub(/\r\n?/, '')].join(' ')
end

#tuple?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/framecurve/comment.rb', line 10

def tuple?
  false
end