Class: PMLCode::Content::Line
- Inherits:
-
Object
- Object
- PMLCode::Content::Line
- Defined in:
- lib/pmlcode/content.rb
Instance Attribute Summary collapse
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
- #highlighted? ⇒ Boolean
- #in_part?(part = nil) ⇒ Boolean
-
#initialize(text, parts = [], highlighted = false) ⇒ Line
constructor
A new instance of Line.
Constructor Details
#initialize(text, parts = [], highlighted = false) ⇒ Line
Returns a new instance of Line.
29 30 31 32 33 |
# File 'lib/pmlcode/content.rb', line 29 def initialize(text, parts = [], highlighted = false) @text = text @parts = parts @highlighted = highlighted end |
Instance Attribute Details
#text ⇒ Object (readonly)
Returns the value of attribute text.
27 28 29 |
# File 'lib/pmlcode/content.rb', line 27 def text @text end |
Instance Method Details
#highlighted? ⇒ Boolean
43 44 45 |
# File 'lib/pmlcode/content.rb', line 43 def highlighted? @highlighted end |
#in_part?(part = nil) ⇒ Boolean
35 36 37 38 39 40 41 |
# File 'lib/pmlcode/content.rb', line 35 def in_part?(part = nil) if part @parts.include?(part) else !@parts.empty? end end |