Class: JsonInference::RootNode

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

Instance Method Summary collapse

Methods inherited from BaseNode

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

Constructor Details

This class inherits a constructor from JsonInference::BaseNode

Instance Method Details

#indent_levelObject



114
115
116
# File 'lib/json-inference.rb', line 114

def indent_level
  -1
end

#selectorObject



118
119
120
# File 'lib/json-inference.rb', line 118

def selector
  ':root'
end

#to_s(documents_count) ⇒ Object



122
123
124
125
126
127
128
129
# File 'lib/json-inference.rb', line 122

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