Class: JsonInference::Report

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

Instance Method Summary collapse

Constructor Details

#initializeReport

Returns a new instance of Report.



133
134
135
136
# File 'lib/json-inference.rb', line 133

def initialize
  @documents = []
  @root = RootNode.new
end

Instance Method Details

#<<(document) ⇒ Object



138
139
140
141
# File 'lib/json-inference.rb', line 138

def <<(document)
  @documents << document
  @root << document
end

#to_sObject



143
144
145
146
147
# File 'lib/json-inference.rb', line 143

def to_s
  str = "JsonInference report: #{@documents.size} documents\n"
  str << @root.to_s(@documents.size)
  str
end