Class: FixtureFox::AstTable

Inherits:
AstNode
  • Object
show all
Defined in:
lib/fixture_fox/ast.rb

Overview

Root table

Instance Attribute Summary collapse

Attributes inherited from AstNode

#children, #parent, #type

Instance Method Summary collapse

Methods inherited from AstNode

#dump, #inspect

Constructor Details

#initialize(ast, schema, ident) ⇒ AstTable

Returns a new instance of AstTable.



57
58
59
60
61
62
63
64
65
66
67
# File 'lib/fixture_fox/ast.rb', line 57

def initialize(ast, schema, ident)
  super(ast)
  @ident = ident
  if @ident.value =~ /^(\w+)\.(\w+)$/
    @schema = Ident.new(ident.file, ident.lineno, ident.initial_indent, ident.pos, $1)
    @name = $2
  else
    @schema = schema
    @name = ident.value
  end
end

Instance Attribute Details

#dependent_materialized_viewsObject (readonly)

Initialized by the analyzer



55
56
57
# File 'lib/fixture_fox/ast.rb', line 55

def dependent_materialized_views
  @dependent_materialized_views
end

#identObject (readonly)

Ident token



50
51
52
# File 'lib/fixture_fox/ast.rb', line 50

def ident
  @ident
end

#nameObject (readonly)

String



53
54
55
# File 'lib/fixture_fox/ast.rb', line 53

def name
  @name
end

#schemaObject (readonly)

Ident token



52
53
54
# File 'lib/fixture_fox/ast.rb', line 52

def schema
  @schema
end

Instance Method Details

#to_sObject



69
# File 'lib/fixture_fox/ast.rb', line 69

def to_s() "#{schema.value}.#{name}: AstTable" end