Class: PgGraph::Type::SimpleType

Inherits:
Type show all
Defined in:
lib/pg_graph/type/type.rb

Overview

TODO: Rename to CatalogType or PgType or PostgresType

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Type

#array?, #array_type, #tuple?

Methods inherited from SchemaObject

#schema_identifier

Methods inherited from Node

#dump, #guid, #inspect, #inspect_inner, #schema_identifier

Constructor Details

#initialize(schema, postgres_type) ⇒ SimpleType

Returns a new instance of SimpleType.



222
223
224
225
# File 'lib/pg_graph/type/type.rb', line 222

def initialize(schema, postgres_type)
  super(schema, postgres_type)
  @ruby_class = PgGraph.inflector.postgres_type2ruby_class(postgres_type)
end

Instance Attribute Details

#ruby_classObject (readonly)

Returns the value of attribute ruby_class.



216
217
218
# File 'lib/pg_graph/type/type.rb', line 216

def ruby_class
  @ruby_class
end

Instance Method Details

#identifierObject



217
# File 'lib/pg_graph/type/type.rb', line 217

def identifier() ruby_class.to_s end

#rankObject



219
# File 'lib/pg_graph/type/type.rb', line 219

def rank() 0 end

#value?Boolean

Returns:

  • (Boolean)


220
# File 'lib/pg_graph/type/type.rb', line 220

def value?() true end