Class: TreeHaver::Backends::Commonmarker::Tree

Inherits:
Object
  • Object
show all
Defined in:
lib/tree_haver/backends/commonmarker.rb

Overview

Commonmarker tree wrapper

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(document, source) ⇒ Tree

Returns a new instance of Tree.



149
150
151
152
153
# File 'lib/tree_haver/backends/commonmarker.rb', line 149

def initialize(document, source)
  @inner_tree = document
  @source = source
  @lines = source.lines
end

Instance Attribute Details

#inner_treeObject (readonly)

Returns the value of attribute inner_tree.



147
148
149
# File 'lib/tree_haver/backends/commonmarker.rb', line 147

def inner_tree
  @inner_tree
end

#sourceObject (readonly)

Returns the value of attribute source.



147
148
149
# File 'lib/tree_haver/backends/commonmarker.rb', line 147

def source
  @source
end

Instance Method Details

#commentsObject



167
168
169
# File 'lib/tree_haver/backends/commonmarker.rb', line 167

def comments
  []
end

#errorsObject



159
160
161
# File 'lib/tree_haver/backends/commonmarker.rb', line 159

def errors
  []
end

#inspectObject



171
172
173
# File 'lib/tree_haver/backends/commonmarker.rb', line 171

def inspect
  "#<TreeHaver::Backends::Commonmarker::Tree>"
end

#root_nodeObject



155
156
157
# File 'lib/tree_haver/backends/commonmarker.rb', line 155

def root_node
  Node.new(@inner_tree, @source, @lines)
end

#warningsObject



163
164
165
# File 'lib/tree_haver/backends/commonmarker.rb', line 163

def warnings
  []
end