Class: Coradoc::Element::List::Definition
- Defined in:
- lib/coradoc/element/list/definition.rb
Instance Attribute Summary collapse
-
#delimiter ⇒ Object
Returns the value of attribute delimiter.
-
#items ⇒ Object
Returns the value of attribute items.
Attributes inherited from Core
Instance Method Summary collapse
-
#initialize(items, options = {}) ⇒ Definition
constructor
A new instance of Definition.
- #prefix ⇒ Object
- #to_adoc ⇒ Object
Methods inherited from Base
children_accessors, #children_accessors, declare_children, #simplify_block_content, visit, #visit
Constructor Details
#initialize(items, options = {}) ⇒ Definition
Returns a new instance of Definition.
7 8 9 10 11 |
# File 'lib/coradoc/element/list/definition.rb', line 7 def initialize(items, = {}) @items = items @delimiter = .fetch(:delimiter, "::") # super(items, options) end |
Instance Attribute Details
#delimiter ⇒ Object
Returns the value of attribute delimiter.
5 6 7 |
# File 'lib/coradoc/element/list/definition.rb', line 5 def delimiter @delimiter end |
#items ⇒ Object
Returns the value of attribute items.
5 6 7 |
# File 'lib/coradoc/element/list/definition.rb', line 5 def items @items end |
Instance Method Details
#prefix ⇒ Object
13 14 15 |
# File 'lib/coradoc/element/list/definition.rb', line 13 def prefix @delimiter end |
#to_adoc ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/coradoc/element/list/definition.rb', line 17 def to_adoc content = "\n" @items.each do |item| content << item.to_adoc(@delimiter) end content end |