Class: PgMeta::View
Direct Known Subclasses
Instance Attribute Summary collapse
-
#defining_relations ⇒ Object
readonly
List of views and tables used directly in the definition of this view.
-
#defining_tables ⇒ Object
readonly
List of tables used directly or indirectly in the definition of this view.
Attributes inherited from Table
#check_constraints, #columns, #constraints, #primary_key_columns, #primary_key_constraints, #referential_constraints, #triggers, #unique_constraints
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(schema, name, is_insertable, is_typed) ⇒ View
constructor
A new instance of View.
- #table? ⇒ Boolean
- #to_h ⇒ Object
Methods inherited from Table
#[], #depending_tables, #depending_views, #insertable?, #materialized?, #primary_key_column, #typed?, #view?
Methods inherited from Node
#dump, #dump_value, #guid, #inspect, #sid, #to_s, #to_yaml, #uid
Constructor Details
#initialize(schema, name, is_insertable, is_typed) ⇒ View
Returns a new instance of View.
290 291 292 293 294 |
# File 'lib/pg_meta/meta.rb', line 290 def initialize(schema, name, is_insertable, is_typed) super @defining_relations = [] @defining_tables = [] end |
Instance Attribute Details
#defining_relations ⇒ Object (readonly)
List of views and tables used directly in the definition of this view
283 284 285 |
# File 'lib/pg_meta/meta.rb', line 283 def defining_relations @defining_relations end |
#defining_tables ⇒ Object (readonly)
List of tables used directly or indirectly in the definition of this view
286 287 288 |
# File 'lib/pg_meta/meta.rb', line 286 def defining_tables @defining_tables end |
Instance Method Details
#table? ⇒ Boolean
288 |
# File 'lib/pg_meta/meta.rb', line 288 def table?() false end |
#to_h ⇒ Object
296 297 298 299 300 301 |
# File 'lib/pg_meta/meta.rb', line 296 def to_h() h = super h[:defining_relations] = defining_relations.map(&:uid) h[:defining_tables] = defining_tables.map(&:uid) h end |