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.
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.
9 10 11 12 13 |
# File 'lib/coradoc/element/list/definition.rb', line 9 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
15 16 17 |
# File 'lib/coradoc/element/list/definition.rb', line 15 def prefix @delimiter end |
#to_adoc ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/coradoc/element/list/definition.rb', line 19 def to_adoc content = "\n" @items.each do |item| content << item.to_adoc(@delimiter) end content end |