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.



11
12
13
14
# File 'lib/json-inference.rb', line 11

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

Instance Method Details

#<<(document) ⇒ Object



16
17
18
19
# File 'lib/json-inference.rb', line 16

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

#to_sObject



21
22
23
24
25
# File 'lib/json-inference.rb', line 21

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