Class: Piglet::Relation::Limit

Inherits:
Object
  • Object
show all
Includes:
Relation
Defined in:
lib/piglet/relation/limit.rb

Overview

:nodoc:

Instance Attribute Summary

Attributes included from Relation

#sources

Instance Method Summary collapse

Methods included from Relation

#[], #alias, #cogroup, #cross, #distinct, #eql?, #field, #filter, #foreach, #group, #hash, #join, #limit, #method_missing, #nested_foreach, #next_field_alias, #order, #sample, #schema, #split, #stream, #union

Constructor Details

#initialize(relation, interpreter, n) ⇒ Limit

Returns a new instance of Limit.



8
9
10
# File 'lib/piglet/relation/limit.rb', line 8

def initialize(relation, interpreter, n)
  @sources, @interpreter, @n = [relation], interpreter, n
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Piglet::Relation::Relation

Instance Method Details

#to_sObject



12
13
14
# File 'lib/piglet/relation/limit.rb', line 12

def to_s
  "LIMIT #{@sources.first.alias} #{@n}"
end