Class: Coradoc::Element::Include
- Inherits:
-
Object
- Object
- Coradoc::Element::Include
- Defined in:
- lib/coradoc/element/include.rb
Instance Attribute Summary collapse
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(path, options = {}) ⇒ Include
constructor
A new instance of Include.
- #to_adoc ⇒ Object
Constructor Details
#initialize(path, options = {}) ⇒ Include
Returns a new instance of Include.
6 7 8 9 10 |
# File 'lib/coradoc/element/include.rb', line 6 def initialize(path, = {}) @path = path @attributes = .fetch(:attributes, AttributeList.new) @line_break = .fetch(:line_break, "\n") end |
Instance Attribute Details
#text ⇒ Object
Returns the value of attribute text.
4 5 6 |
# File 'lib/coradoc/element/include.rb', line 4 def text @text end |
Instance Method Details
#to_adoc ⇒ Object
12 13 14 15 |
# File 'lib/coradoc/element/include.rb', line 12 def to_adoc attrs = @attributes.to_adoc(true) "include::#{@path}#{attrs}#{@line_break}" end |