Class: MassInsert::Result
- Inherits:
-
Object
- Object
- MassInsert::Result
- 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
-
#building_time ⇒ Object
Returns the time that took to create the query or queries string that was persisted.
-
#execution_time ⇒ Object
Returns the time that took to execute the query or queries string that was persisted.
-
#initialize(process) ⇒ Result
constructor
A new instance of Result.
-
#records ⇒ Object
Returns the amount of records that were persisted.
-
#time ⇒ Object
Returns the time that took to do all the MassInsert process.
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_time ⇒ Object
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_time ⇒ Object
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 |
#records ⇒ Object
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 |
#time ⇒ Object
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 |