Class: Indexers::Proxy
- Inherits:
-
Object
- Object
- Indexers::Proxy
- Defined in:
- lib/indexers/proxy.rb
Instance Method Summary collapse
-
#initialize(name, options = {}, &block) ⇒ Proxy
constructor
A new instance of Proxy.
- #trait(name, &block) ⇒ Object
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, ={}, &block) @name = name @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 |