Method: Elastictastic::ScopeBuilder#method_missing

Defined in:
lib/elastictastic/scope_builder.rb

#method_missing(method, *args, &block) ⇒ Object



21
22
23
24
25
26
27
28
29
30
# File 'lib/elastictastic/scope_builder.rb', line 21

def method_missing(method, *args, &block)
  args << ScopeBuilder.build(&block) if block
  value =
    case args.length
    when 0 then {}
    when 1 then args.first
    else args
    end
  @scope[method.to_s] = value
end