Class: ROM::SQL::DSL Private

Inherits:
BasicObject
Defined in:
lib/rom/sql/dsl.rb

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.

Direct Known Subclasses

GroupDSL, OrderDSL, ProjectionDSL, RestrictionDSL

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(schema) ⇒ DSL

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 DSL.



9
10
11
# File 'lib/rom/sql/dsl.rb', line 9

def initialize(schema)
  @schema = schema
end

Instance Attribute Details

#schemaObject (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.



6
7
8
# File 'lib/rom/sql/dsl.rb', line 6

def schema
  @schema
end

Instance Method Details

#call(&block) ⇒ 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.



14
15
16
17
18
19
20
21
22
# File 'lib/rom/sql/dsl.rb', line 14

def call(&block)
  result = instance_exec(&block)

  if result.is_a?(::Array)
    result
  else
    [result]
  end
end

#respond_to_missing?(name, include_private = false) ⇒ Boolean

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:

  • (Boolean)


25
26
27
# File 'lib/rom/sql/dsl.rb', line 25

def respond_to_missing?(name, include_private = false)
  super || schema.key?(name)
end