Module: ROM::SQL::AttributeAliasing Private
- Included in:
- Attribute
- Defined in:
- lib/rom/sql/attribute_aliasing.rb
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
-
#aliased(alias_name) ⇒ SQL::Attribute
(also: #as)
Return a new attribute with an alias.
-
#aliased_projection? ⇒ TrueClass, FalseClass
private
Return true if this attribute is an aliased projection.
Instance Method Details
#aliased(alias_name) ⇒ SQL::Attribute Also known as: as
Return a new attribute with an alias
15 16 17 18 19 20 21 |
# File 'lib/rom/sql/attribute_aliasing.rb', line 15 def aliased(alias_name) new_name, new_alias_name = extract_alias_names(alias_name) super(new_alias_name).with(name: new_name).( sql_expr: alias_sql_expr(sql_expr, new_alias_name) ) end |
#aliased_projection? ⇒ TrueClass, FalseClass
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.
Return true if this attribute is an aliased projection
48 49 50 |
# File 'lib/rom/sql/attribute_aliasing.rb', line 48 def aliased_projection? self.[:sql_expr].is_a?(Sequel::SQL::AliasedExpression) end |