Class: Arel::Compound

Inherits:
Object
  • Object
show all
Includes:
Relation
Defined in:
lib/arel/algebra/relations/utilities/compound.rb

Direct Known Subclasses

Action, Alias, Externalization, From, Group, Having, Lock, Order, Project, Skip, Take, Where

Instance Attribute Summary collapse

Attributes included from Relation

#count

Instance Method Summary collapse

Methods included from Relation

#[], #alias, #bind, #call, #christener, #compiler, #delete, #each, #exclusion_predicate_sql, #externalize, #find_attribute_matching_name, #from, #from_clauses, #group_clauses, #groupings, #having_clauses, #havings, #inclusion_predicate_sql, #insert, #inserts, #join, #lock, #locked, #order_clauses, #orders, #outer_join, #position_of, #primary_key, #project, #projections, #select_clauses, #session, #skip, #take, #to_sql, #update, #where, #where_clauses, #wheres

Constructor Details

#initialize(relation) ⇒ Compound

Returns a new instance of Compound.



7
8
9
10
11
12
13
14
15
16
# File 'lib/arel/algebra/relations/utilities/compound.rb', line 7

def initialize relation
  @relation    = relation
  @engine      = relation.engine
  @attributes  = nil
  @wheres      = nil
  @groupings   = nil
  @orders      = nil
  @havings     = nil
  @projections = nil
end

Instance Attribute Details

#engineObject (readonly)

Returns the value of attribute engine.



5
6
7
# File 'lib/arel/algebra/relations/utilities/compound.rb', line 5

def engine
  @engine
end

#relationObject (readonly)

Returns the value of attribute relation.



5
6
7
# File 'lib/arel/algebra/relations/utilities/compound.rb', line 5

def relation
  @relation
end

Instance Method Details

#attributesObject



47
48
49
# File 'lib/arel/algebra/relations/utilities/compound.rb', line 47

def attributes
  @attributes ||= relation.attributes.bind(self)
end

#column_for(attr) ⇒ Object



24
# File 'lib/arel/algebra/relations/utilities/compound.rb', line 24

def column_for attr; @relation.column_for attr end

#externalizable?Boolean

Returns:

  • (Boolean)


25
# File 'lib/arel/algebra/relations/utilities/compound.rb', line 25

def externalizable?; @relation.externalizable? end

#join?Boolean

Returns:

  • (Boolean)


18
# File 'lib/arel/algebra/relations/utilities/compound.rb', line 18

def join?;           @relation.join?           end

#joins(env) ⇒ Object



23
# File 'lib/arel/algebra/relations/utilities/compound.rb', line 23

def joins env;       @relation.joins env       end

#nameObject



19
# File 'lib/arel/algebra/relations/utilities/compound.rb', line 19

def name;            @relation.name            end

#skippedObject



21
# File 'lib/arel/algebra/relations/utilities/compound.rb', line 21

def skipped;         @relation.skipped         end

#sourcesObject



27
28
29
# File 'lib/arel/algebra/relations/utilities/compound.rb', line 27

def sources
  @relation.sources
end

#tableObject



31
32
33
# File 'lib/arel/algebra/relations/utilities/compound.rb', line 31

def table
  @relation.table
end

#table_aliasObject



20
# File 'lib/arel/algebra/relations/utilities/compound.rb', line 20

def table_alias;     @relation.table_alias     end

#table_sql(formatter = Sql::TableReference.new(self)) ⇒ Object



35
36
37
# File 'lib/arel/algebra/relations/utilities/compound.rb', line 35

def table_sql(formatter = Sql::TableReference.new(self))
  @relation.table_sql formatter
end

#takenObject



22
# File 'lib/arel/algebra/relations/utilities/compound.rb', line 22

def taken;           @relation.taken           end

#unoperated_rowsObject



51
52
53
# File 'lib/arel/algebra/relations/utilities/compound.rb', line 51

def unoperated_rows
  relation.call.collect { |row| row.bind(self) }
end