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.



173
174
175
176
177
# File 'lib/tree_haver/backends/commonmarker.rb', line 173

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.



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

def inner_tree
  @inner_tree
end

#sourceObject (readonly)

Returns the value of attribute source.



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

def source
  @source
end

Instance Method Details

#commentsObject



191
192
193
# File 'lib/tree_haver/backends/commonmarker.rb', line 191

def comments
  []
end

#errorsObject



183
184
185
# File 'lib/tree_haver/backends/commonmarker.rb', line 183

def errors
  []
end

#inspectObject



195
196
197
# File 'lib/tree_haver/backends/commonmarker.rb', line 195

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

#root_nodeObject



179
180
181
# File 'lib/tree_haver/backends/commonmarker.rb', line 179

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

#warningsObject



187
188
189
# File 'lib/tree_haver/backends/commonmarker.rb', line 187

def warnings
  []
end