Class: Arel::Take
- Defined in:
- lib/arel/algebra/relations/operations/take.rb
Instance Attribute Summary collapse
-
#taken ⇒ Object
readonly
Returns the value of attribute taken.
Attributes inherited from Compound
Attributes included from Relation
Instance Method Summary collapse
- #eval ⇒ Object
- #externalizable? ⇒ Boolean
-
#initialize(relation, taken) ⇒ Take
constructor
A new instance of Take.
Methods inherited from Compound
#attributes, #column_for, #join?, #joins, #name, #skipped, #sources, #table, #table_alias, #table_sql, #unoperated_rows
Methods included from Relation
#[], #alias, #attributes, #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, #join?, #joins, #lock, #locked, #order_clauses, #orders, #outer_join, #position_of, #primary_key, #project, #projections, #select_clauses, #session, #skip, #skipped, #sources, #take, #to_sql, #update, #where, #where_clauses, #wheres
Constructor Details
#initialize(relation, taken) ⇒ Take
Returns a new instance of Take.
5 6 7 8 |
# File 'lib/arel/algebra/relations/operations/take.rb', line 5 def initialize relation, taken super(relation) @taken = taken end |
Instance Attribute Details
#taken ⇒ Object (readonly)
Returns the value of attribute taken.
3 4 5 |
# File 'lib/arel/algebra/relations/operations/take.rb', line 3 def taken @taken end |
Instance Method Details
#eval ⇒ Object
14 15 16 |
# File 'lib/arel/algebra/relations/operations/take.rb', line 14 def eval unoperated_rows[0, taken] end |
#externalizable? ⇒ Boolean
10 11 12 |
# File 'lib/arel/algebra/relations/operations/take.rb', line 10 def externalizable? true end |