Class: Piglet::Relation::Order
- Inherits:
-
Object
- Object
- Piglet::Relation::Order
- Includes:
- Relation
- Defined in:
- lib/piglet/relation/order.rb
Overview
:nodoc:
Instance Attribute Summary
Attributes included from Relation
Instance Method Summary collapse
-
#initialize(relation, fields, options) ⇒ Order
constructor
A new instance of Order.
- #to_s ⇒ Object
Methods included from Relation
#[], #alias, #cogroup, #cross, #distinct, #eql?, #field, #filter, #foreach, #group, #hash, #join, #limit, #method_missing, #order, #sample, #schema, #split, #stream, #union
Constructor Details
#initialize(relation, fields, options) ⇒ Order
8 9 10 11 12 |
# File 'lib/piglet/relation/order.rb', line 8 def initialize(relation, fields, ) ||= {} @sources, @parallel = [relation], [:parallel] @fields = fields.is_a?(Enumerable) ? fields : [fields] end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Piglet::Relation::Relation
Instance Method Details
#to_s ⇒ Object
14 15 16 |
# File 'lib/piglet/relation/order.rb', line 14 def to_s "ORDER #{@sources.first.alias} BY #{field_strings}" end |