Class: Coradoc::Document::Block
- Inherits:
-
Object
- Object
- Coradoc::Document::Block
- Defined in:
- lib/coradoc/document/block.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#lines ⇒ Object
readonly
Returns the value of attribute lines.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(title, options = {}) ⇒ Block
constructor
A new instance of Block.
- #type ⇒ Object
Constructor Details
#initialize(title, options = {}) ⇒ Block
Returns a new instance of Block.
5 6 7 8 9 10 11 |
# File 'lib/coradoc/document/block.rb', line 5 def initialize(title, = {}) @title = title @lines = .fetch(:lines, []) @type_str = .fetch(:type, nil) @delimiter = .fetch(:delimiter, "") @attributes = .fetch(:attributes, {}) end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
3 4 5 |
# File 'lib/coradoc/document/block.rb', line 3 def attributes @attributes end |
#lines ⇒ Object (readonly)
Returns the value of attribute lines.
3 4 5 |
# File 'lib/coradoc/document/block.rb', line 3 def lines @lines end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
3 4 5 |
# File 'lib/coradoc/document/block.rb', line 3 def title @title end |
Instance Method Details
#type ⇒ Object
13 14 15 |
# File 'lib/coradoc/document/block.rb', line 13 def type @type ||= defined_type || type_from_delimiter end |