Class: Elasticsearch::Model::Proxy::InstanceMethodsProxy

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/elasticsearch/model/proxy.rb

Overview

A proxy interfacing between Elasticsearch::Model instance methods and model instance methods

TODO: Inherit from BasicObject and make Pry’s ‘ls` command behave?

Instance Attribute Summary

Attributes included from Base

#target

Instance Method Summary collapse

Methods included from Base

#initialize, #inspect, #method_missing, #respond_to?

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Elasticsearch::Model::Proxy::Base

Instance Method Details

#as_json(options = {}) ⇒ Object

Need to redefine ‘as_json` because we’re not inheriting from ‘BasicObject`; see TODO note above.



136
137
138
# File 'lib/elasticsearch/model/proxy.rb', line 136

def as_json(options={})
  target.as_json(options)
end

#classObject



129
130
131
# File 'lib/elasticsearch/model/proxy.rb', line 129

def class
  klass.__elasticsearch__
end

#klassObject



125
126
127
# File 'lib/elasticsearch/model/proxy.rb', line 125

def klass
  target.class
end