Class: Coradoc::Document::Title
- Inherits:
-
Object
- Object
- Coradoc::Document::Title
- Defined in:
- lib/coradoc/document/title.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
(also: #text)
readonly
Returns the value of attribute content.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#line_break ⇒ Object
readonly
Returns the value of attribute line_break.
Instance Method Summary collapse
-
#initialize(content, level, options = {}) ⇒ Title
constructor
A new instance of Title.
- #level ⇒ Object
Constructor Details
#initialize(content, level, options = {}) ⇒ Title
Returns a new instance of Title.
6 7 8 9 10 11 |
# File 'lib/coradoc/document/title.rb', line 6 def initialize(content, level, = {}) @level_str = level @content = content.to_s @id = .fetch(:id, nil).to_s @line_break = .fetch(:line_break, "") end |
Instance Attribute Details
#content ⇒ Object (readonly) Also known as: text
Returns the value of attribute content.
4 5 6 |
# File 'lib/coradoc/document/title.rb', line 4 def content @content end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/coradoc/document/title.rb', line 4 def id @id end |
#line_break ⇒ Object (readonly)
Returns the value of attribute line_break.
4 5 6 |
# File 'lib/coradoc/document/title.rb', line 4 def line_break @line_break end |
Instance Method Details
#level ⇒ Object
13 14 15 |
# File 'lib/coradoc/document/title.rb', line 13 def level @level ||= level_from_string end |