Class: ROM::SQL::QualifiedAttribute Private

Inherits:
Object
  • Object
show all
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

Class Method Summary collapse

Instance Method Summary collapse

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

#attributeObject (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

#datasetObject (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_symSymbol

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

Returns:

  • (Symbol)


48
49
50
# File 'lib/rom/sql/qualified_attribute.rb', line 48

def to_sym
  attribute
end