Class: Indexers::Proxy

Inherits:
Object
  • Object
show all
Defined in:
lib/indexers/proxy.rb

Instance Method Summary collapse

Constructor Details

#initialize(name, options = {}, &block) ⇒ Proxy

Returns a new instance of Proxy.



4
5
6
7
8
9
# File 'lib/indexers/proxy.rb', line 4

def initialize(name, options={}, &block)
  @name = name
  @options = options.merge(traits: {})
  instance_eval &block
  Indexers.definitions.add name, @options
end

Instance Method Details

#trait(name, &block) ⇒ Object



17
18
19
# File 'lib/indexers/proxy.rb', line 17

def trait(name, &block)
  @options[:traits][name] = block
end