Class: ThinkingTank::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/thinkingtank/init.rb

Instance Method Summary collapse

Constructor Details

#initialize(model, &block) ⇒ Builder

Returns a new instance of Builder.



12
13
14
15
# File 'lib/thinkingtank/init.rb', line 12

def initialize(model, &block)
    @index_fields = []
    self.instance_eval &block
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method) ⇒ Object



25
26
27
# File 'lib/thinkingtank/init.rb', line 25

def method_missing(method)
    return method
end

Instance Method Details

#index_fieldsObject



22
23
24
# File 'lib/thinkingtank/init.rb', line 22

def index_fields
    return @index_fields
end

#indexes(*args) ⇒ Object



16
17
18
19
20
21
# File 'lib/thinkingtank/init.rb', line 16

def indexes(*args)
    options = args.extract_options!
    args.each do |field|
        @index_fields << field
    end
end