Class: Coradoc::Element::Block::Side
- Inherits:
-
Core
- Object
- Coradoc::Element::Base
- Core
- Coradoc::Element::Block::Side
- Defined in:
- lib/coradoc/element/block/side.rb
Instance Attribute Summary
Attributes inherited from Core
#attributes, #id, #lang, #lines, #title
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Side
constructor
A new instance of Side.
- #to_adoc ⇒ Object
Methods inherited from Core
#gen_anchor, #gen_attributes, #gen_delimiter, #gen_lines, #gen_title, #type
Methods inherited from Coradoc::Element::Base
#children_accessors, children_accessors, declare_children, #simplify_block_content, visit, #visit
Constructor Details
#initialize(options = {}) ⇒ Side
Returns a new instance of Side.
5 6 7 8 9 10 11 |
# File 'lib/coradoc/element/block/side.rb', line 5 def initialize( = {}) @title = .fetch(:title, "") @attributes = .fetch(:attributes, AttributeList.new) @delimiter_char = "*" @delimiter_len = .fetch(:delimiter_len, 4) @lines = .fetch(:lines, []) end |
Instance Method Details
#to_adoc ⇒ Object
13 14 15 |
# File 'lib/coradoc/element/block/side.rb', line 13 def to_adoc "\n\n#{gen_title}#{gen_attributes}#{gen_delimiter}\n" << gen_lines << "\n#{gen_delimiter}\n\n" end |