Class: Sunspot::SessionProxy::AbstractSessionProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/sunspot/session_proxy/abstract_session_proxy.rb

Overview

:nodoc:

Class Method Summary collapse

Class Method Details

.delegate(*args) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/sunspot/session_proxy/abstract_session_proxy.rb', line 5

def delegate(*args)
  options = Util.extract_options_from(args)
  delegate = options[:to]
  args.each do |method|
    module_eval("      def \#{method}(*args, &block)\n        \#{delegate}.\#{method}(*args, &block)\n      end\n    RUBY\n  end\nend\n", __FILE__, __LINE__ + 1)

.not_supported(*methods) ⇒ Object



17
18
19
20
21
22
23
24
25
# File 'lib/sunspot/session_proxy/abstract_session_proxy.rb', line 17

def not_supported(*methods)
  methods.each do |method|
    module_eval("      def \#{method}(*args, &block)\n        raise NotSupportedError, \"\#{name} does not support \#{method.inspect}\"\n      end\n    RUBY\n  end\nend\n", __FILE__, __LINE__ + 1)