Class: Scenic::View
- Inherits:
-
Object
- Object
- Scenic::View
- Defined in:
- lib/scenic/view.rb
Overview
The in-memory representation of a view definition.
This object is used internally by adapters and the schema dumper and is not intended to be used by application code. It is documented here for use by adapter gems.
Instance Attribute Summary collapse
-
#definition ⇒ String
readonly
The SQL schema for the query that defines the view.
-
#materialized ⇒ Boolean
readonly
True if the view is materialized.
-
#name ⇒ String
readonly
The name of the view.
Instance Method Summary collapse
- #escaped_definition ⇒ Object
-
#initialize(name:, definition:, materialized:) ⇒ View
constructor
Returns a new instance of View.
Constructor Details
#initialize(name:, definition:, materialized:) ⇒ View
Returns a new instance of View.
30 31 32 33 34 |
# File 'lib/scenic/view.rb', line 30 def initialize(name:, definition:, materialized:) @name = name @definition = definition @materialized = materialized end |
Instance Attribute Details
#definition ⇒ String (readonly)
The SQL schema for the query that defines the view
19 20 21 |
# File 'lib/scenic/view.rb', line 19 def definition @definition end |
#materialized ⇒ Boolean (readonly)
True if the view is materialized
23 24 25 |
# File 'lib/scenic/view.rb', line 23 def materialized @materialized end |
#name ⇒ String (readonly)
The name of the view
12 13 14 |
# File 'lib/scenic/view.rb', line 12 def name @name end |
Instance Method Details
#escaped_definition ⇒ Object
54 55 56 |
# File 'lib/scenic/view.rb', line 54 def escaped_definition definition.gsub("\\", "\\\\\\") end |