Class: JsonInference::RootNode

Inherits:
BaseNode
  • Object
show all
Defined in:
lib/json-inference/root_node.rb

Instance Method Summary collapse

Methods inherited from BaseNode

#<<, #each_sub_node, #indent, #initialize

Constructor Details

This class inherits a constructor from JsonInference::BaseNode

Instance Method Details

#indent_levelObject



3
4
5
# File 'lib/json-inference/root_node.rb', line 3

def indent_level
  -1
end

#selectorObject



7
8
9
# File 'lib/json-inference/root_node.rb', line 7

def selector
  ':root'
end

#to_s(documents_count) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/json-inference/root_node.rb', line 11

def to_s(documents_count)
  str = ""
  each_sub_node do |sub_node|
    str << sub_node.to_s(documents_count)
    str << "\n"
  end
  str
end