Class: PgObjects::ParsedObject::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/pg_objects/parsed_object/base.rb

Overview

Base class for parsed objects

Instance Method Summary collapse

Constructor Details

#initialize(stmt) ⇒ Base

Returns a new instance of Base.



7
8
9
# File 'lib/pg_objects/parsed_object/base.rb', line 7

def initialize(stmt)
  @stmt = stmt
end

Instance Method Details

#nameObject

Raises:

  • (NotImplementedError)


11
12
13
# File 'lib/pg_objects/parsed_object/base.rb', line 11

def name
  raise NotImplementedError
end

#qualified_nameObject

Schema-qualified name (+schema.name+) when a schema is present, otherwise the same as name. Used to disambiguate same-named objects across schemas.



17
18
19
20
# File 'lib/pg_objects/parsed_object/base.rb', line 17

def qualified_name
  schema_name = schema
  schema_name && !schema_name.empty? ? "#{schema_name}.#{name}" : name
end