Class: Coradoc::Element::Include

Inherits:
Object
  • Object
show all
Defined in:
lib/coradoc/element/include.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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, options = {})
  @path = path
  @attributes = options.fetch(:attributes, AttributeList.new)
  @line_break = options.fetch(:line_break, "\n")
end

Instance Attribute Details

#textObject

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_adocObject



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