Class: MassInsert::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/mass_insert/result.rb

Overview

This class is responsible to provides the mass insert process results according to the Process class instance.

Instance Method Summary collapse

Constructor Details

#initialize(process) ⇒ Result

Returns a new instance of Result.



6
7
8
# File 'lib/mass_insert/result.rb', line 6

def initialize process
  @process = process
end

Instance Method Details

#building_timeObject

Returns the time that took to create the query or queries string that was persisted.



12
13
14
# File 'lib/mass_insert/result.rb', line 12

def building_time
  @process.instance_variable_get(:@building_time).total
end

#execution_timeObject

Returns the time that took to execute the query or queries string that was persisted.



18
19
20
# File 'lib/mass_insert/result.rb', line 18

def execution_time
  @process.instance_variable_get(:@execution_time).total
end

#recordsObject

Returns the amount of records that were persisted.



28
29
30
# File 'lib/mass_insert/result.rb', line 28

def records
  @process.instance_variable_get(:@values).count
end

#timeObject

Returns the time that took to do all the MassInsert process.



23
24
25
# File 'lib/mass_insert/result.rb', line 23

def time
  building_time + execution_time
end