Class: PgGraph::Type::SimpleType
- Inherits:
-
Type
- Object
- HashTree::Set
- Node
- SchemaObject
- Type
- PgGraph::Type::SimpleType
- Defined in:
- lib/pg_graph/type/type.rb
Overview
TODO: Rename to CatalogType or PgType or PostgresType
Instance Attribute Summary collapse
-
#ruby_class ⇒ Object
readonly
Returns the value of attribute ruby_class.
Instance Method Summary collapse
- #identifier ⇒ Object
-
#initialize(schema, postgres_type) ⇒ SimpleType
constructor
A new instance of SimpleType.
- #rank ⇒ Object
- #value? ⇒ Boolean
Methods inherited from Type
Methods inherited from SchemaObject
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_class ⇒ Object (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
#identifier ⇒ Object
217 |
# File 'lib/pg_graph/type/type.rb', line 217 def identifier() ruby_class.to_s end |
#rank ⇒ Object
219 |
# File 'lib/pg_graph/type/type.rb', line 219 def rank() 0 end |
#value? ⇒ Boolean
220 |
# File 'lib/pg_graph/type/type.rb', line 220 def value?() true end |