Class: Upkeep::SQLGlot::Source
- Inherits:
-
Data
- Object
- Data
- Upkeep::SQLGlot::Source
- Defined in:
- lib/upkeep/sqlglot.rb
Instance Attribute Summary collapse
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
-
#table ⇒ Object
readonly
Returns the value of attribute table.
Class Method Summary collapse
Instance Attribute Details
#kind ⇒ Object (readonly)
Returns the value of attribute kind
77 78 79 |
# File 'lib/upkeep/sqlglot.rb', line 77 def kind @kind end |
#scope ⇒ Object (readonly)
Returns the value of attribute scope
77 78 79 |
# File 'lib/upkeep/sqlglot.rb', line 77 def scope @scope end |
#table ⇒ Object (readonly)
Returns the value of attribute table
77 78 79 |
# File 'lib/upkeep/sqlglot.rb', line 77 def table @table end |
Class Method Details
.from_native(value) ⇒ Object
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/upkeep/sqlglot.rb', line 78 def self.from_native(value) case value.fetch("kind") when "table" new( kind: :table, table: TableRef.from_native(value.fetch("table")), scope: nil ) when "scope" new( kind: :scope, table: nil, scope: Scope.from_native(value.fetch("scope")) ) else raise KeyError, "Unknown SQLGlot source kind: #{value["kind"].inspect}" end end |