Class: ROM::SQL::ProjectionDSL
- Inherits:
-
DSL
- Object
- DSL
- ROM::SQL::ProjectionDSL
- Defined in:
- lib/rom/sql/projection_dsl.rb
Overview
Projection DSL used in reading API (select
, select_append
etc.)
Instance Method Summary collapse
-
#`(value) ⇒ Attribute
Return a string literal that will be directly used in an SQL statement or query.
-
#function(name, *attrs) ⇒ Rom::SQL::Function
(also: #f)
Return a SQL function with value
Any
.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, *args, &block) ⇒ Object (private)
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.
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/rom/sql/projection_dsl.rb', line 52 def method_missing(meth, *args, &block) if schema.key?(meth) schema[meth] else type = type(meth) if type if args.empty? ::ROM::SQL::Function.new(type, schema: schema) else ::ROM::SQL::Attribute[type].value(args[0]) end else super end end end |