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, #to_yaml, #uid
Constructor Details
#initialize(schema, name, is_insertable, is_typed) ⇒ View
273 274 275 276 277 |
# File 'lib/pg_meta/meta.rb', line 273 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
266 267 268 |
# File 'lib/pg_meta/meta.rb', line 266 def defining_relations @defining_relations end |
#defining_tables ⇒ Object (readonly)
List of tables used directly or indirectly in the definition of this view
269 270 271 |
# File 'lib/pg_meta/meta.rb', line 269 def defining_tables @defining_tables end |
Instance Method Details
#table? ⇒ Boolean
271 |
# File 'lib/pg_meta/meta.rb', line 271 def table?() false end |
#to_h ⇒ Object
279 280 281 282 283 284 |
# File 'lib/pg_meta/meta.rb', line 279 def to_h() h = super h[:defining_relations] = defining_relations.map(&:uid) h[:defining_tables] = defining_tables.map(&:uid) h end |