Class: Stretchy::Filters::OrFilter

Inherits:
Base
  • Object
show all
Defined in:
lib/stretchy/filters/or_filter.rb

Constant Summary

Constants included from Utils::Contract

Utils::Contract::ASSERTIONS, Utils::Contract::DECAY_FUNCTIONS, Utils::Contract::DISTANCE_FORMAT

Instance Method Summary collapse

Methods included from Utils::Contract

included, #require_one, #validate!

Constructor Details

#initialize(*args) ⇒ OrFilter

Returns a new instance of OrFilter.



9
10
11
12
# File 'lib/stretchy/filters/or_filter.rb', line 9

def initialize(*args)
  @filters = args.flatten
  validate!
end

Instance Method Details

#to_searchObject



14
15
16
17
18
# File 'lib/stretchy/filters/or_filter.rb', line 14

def to_search
  {
    or: @filters.map(&:to_search)
  }
end