Class: QueryConsole::ExplainRunner::ExplainResult

Inherits:
Object
  • Object
show all
Defined in:
app/services/query_console/explain_runner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(plan_text: nil, execution_time_ms: 0, error: nil) ⇒ ExplainResult

Returns a new instance of ExplainResult.



8
9
10
11
12
# File 'app/services/query_console/explain_runner.rb', line 8

def initialize(plan_text: nil, execution_time_ms: 0, error: nil)
  @plan_text = plan_text
  @execution_time_ms = execution_time_ms
  @error = error
end

Instance Attribute Details

#errorObject (readonly)

Returns the value of attribute error.



6
7
8
# File 'app/services/query_console/explain_runner.rb', line 6

def error
  @error
end

#execution_time_msObject (readonly)

Returns the value of attribute execution_time_ms.



6
7
8
# File 'app/services/query_console/explain_runner.rb', line 6

def execution_time_ms
  @execution_time_ms
end

#plan_textObject (readonly)

Returns the value of attribute plan_text.



6
7
8
# File 'app/services/query_console/explain_runner.rb', line 6

def plan_text
  @plan_text
end

Instance Method Details

#failure?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'app/services/query_console/explain_runner.rb', line 18

def failure?
  !success?
end

#success?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'app/services/query_console/explain_runner.rb', line 14

def success?
  @error.nil?
end