Class: ROM::SQL::QualifiedAttribute Private
- Inherits:
-
Object
- Object
- ROM::SQL::QualifiedAttribute
- Extended by:
- Cache
- Defined in:
- lib/rom/sql/qualified_attribute.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Used as a pair table name + field name. Similar to Sequel::SQL::QualifiedIdentifier but we don’t want Sequel types to leak into ROM
Instance Attribute Summary collapse
-
#attribute ⇒ Object
readonly
private
Attribute (field, column) name.
-
#dataset ⇒ Object
readonly
private
Dataset (table) name.
Class Method Summary collapse
- .[](*args) ⇒ Object private
Instance Method Summary collapse
-
#initialize(dataset, attribute) ⇒ QualifiedAttribute
constructor
private
A new instance of QualifiedAttribute.
-
#sql_literal_append(ds, sql) ⇒ Object
private
Used by Sequel for building SQL statements.
-
#to_sym ⇒ Symbol
private
Convinient interface for attribute names.
Constructor Details
#initialize(dataset, attribute) ⇒ QualifiedAttribute
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of QualifiedAttribute.
31 32 33 34 |
# File 'lib/rom/sql/qualified_attribute.rb', line 31 def initialize(dataset, attribute) @dataset = dataset @attribute = attribute end |
Instance Attribute Details
#attribute ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Attribute (field, column) name
23 24 25 |
# File 'lib/rom/sql/qualified_attribute.rb', line 23 def attribute @attribute end |
#dataset ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Dataset (table) name
18 19 20 |
# File 'lib/rom/sql/qualified_attribute.rb', line 18 def dataset @dataset end |
Class Method Details
.[](*args) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
26 27 28 |
# File 'lib/rom/sql/qualified_attribute.rb', line 26 def self.[](*args) fetch_or_store(args) { new(*args) } end |
Instance Method Details
#sql_literal_append(ds, sql) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Used by Sequel for building SQL statements
39 40 41 |
# File 'lib/rom/sql/qualified_attribute.rb', line 39 def sql_literal_append(ds, sql) ds.qualified_identifier_sql_append(sql, dataset, attribute) end |
#to_sym ⇒ Symbol
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Convinient interface for attribute names
48 49 50 |
# File 'lib/rom/sql/qualified_attribute.rb', line 48 def to_sym attribute end |