Module: ElasticRecord::Delegation

Included in:
Relation
Defined in:
lib/elastic_record/relation/delegation.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object (private)



12
13
14
15
16
17
18
19
20
# File 'lib/elastic_record/relation/delegation.rb', line 12

def method_missing(method, *args, &block)
  if klass.respond_to?(method)
    scoping { klass.send(method, *args, &block) }
  elsif Array.method_defined?(method)
    to_a.send(method, *args, &block)
  else
    super
  end
end

Instance Method Details

#include?(obj) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/elastic_record/relation/delegation.rb', line 7

def include?(obj)
  to_a.include?(obj)
end

#to_aryObject



3
4
5
# File 'lib/elastic_record/relation/delegation.rb', line 3

def to_ary
  to_a.to_ary
end