Class: Doing::Section
Overview
Section Object
Instance Attribute Summary collapse
-
#original ⇒ Object
Returns the value of attribute original.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
- #equal?(other) ⇒ Boolean
-
#initialize(title, original: nil) ⇒ Section
constructor
A new instance of Section.
-
#to_s ⇒ Object
Outputs section title.
Constructor Details
#initialize(title, original: nil) ⇒ Section
Returns a new instance of Section.
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/doing/section.rb', line 8 def initialize(title, original: nil) super() @title = title @original = if original.nil? "#{title}:" else original =~ /:(\s+@[^ (]+(\([^)]*\))?)*?$/ ? original : "#{original}:" end end |
Instance Attribute Details
#original ⇒ Object
Returns the value of attribute original.
6 7 8 |
# File 'lib/doing/section.rb', line 6 def original @original end |
#title ⇒ Object
Returns the value of attribute title.
6 7 8 |
# File 'lib/doing/section.rb', line 6 def title @title end |
Instance Method Details
#equal?(other) ⇒ Boolean
20 21 22 |
# File 'lib/doing/section.rb', line 20 def equal?(other) @title == other.title end |
#to_s ⇒ Object
Outputs section title
25 26 27 |
# File 'lib/doing/section.rb', line 25 def to_s @title end |