Class: Elasticity::Search::ActiveRecordProxy::Relation

Inherits:
ActiveSupport::ProxyObject
  • Object
show all
Defined in:
lib/elasticity/search.rb

Instance Method Summary collapse

Constructor Details

#initialize(relation) ⇒ Relation

Returns a new instance of Relation.



232
233
234
# File 'lib/elasticity/search.rb', line 232

def initialize(relation)
  @relation = relation
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object



236
237
238
# File 'lib/elasticity/search.rb', line 236

def method_missing(name, *args, &block)
  @relation.public_send(name, *args, &block)
end

Instance Method Details

#inspectObject



246
247
248
# File 'lib/elasticity/search.rb', line 246

def inspect
  "#<#{self.class}: #{@relation.to_sql}>"
end

#pretty_print(pp) ⇒ Object



240
241
242
243
244
# File 'lib/elasticity/search.rb', line 240

def pretty_print(pp)
  pp.object_group(self) do
    pp.text " #{@relation.to_sql}"
  end
end