Class: ExplainResult

Inherits:
Object
  • Object
show all
Defined in:
lib/rbhive/explain_result.rb

Instance Method Summary collapse

Constructor Details

#initialize(rows) ⇒ ExplainResult


2
3
4
# File 'lib/rbhive/explain_result.rb', line 2

def initialize(rows)
  @rows = rows
end

Instance Method Details

#astObject


6
7
8
# File 'lib/rbhive/explain_result.rb', line 6

def ast
  by_section[:abstract_syntax_tree].first
end

#rawObject


22
23
24
# File 'lib/rbhive/explain_result.rb', line 22

def raw
  @rows
end

#stage_countObject


10
11
12
# File 'lib/rbhive/explain_result.rb', line 10

def stage_count
  stage_dependencies.length
end

#stage_dependenciesObject


14
15
16
# File 'lib/rbhive/explain_result.rb', line 14

def stage_dependencies
  by_section[:stage_dependencies] || []
end

#to_sObject


26
27
28
# File 'lib/rbhive/explain_result.rb', line 26

def to_s
  to_tsv
end

#to_tsvObject


18
19
20
# File 'lib/rbhive/explain_result.rb', line 18

def to_tsv
  @rows.join("\n")
end