Sha256: 8b2aaf3e5910638b05a6c660a340b1f36dafd96c19c32588eb443be96894a334
Contents?: true
Size: 858 Bytes
Versions: 13
Compression:
Stored size: 858 Bytes
Contents
module CloudSesame module Query module DSL module FilterQueryMethods def included?(field, value = nil) (field_options = dsl_context[:fields][field]) && ( (value && field_options_is(:included, field_options, value)) || (!value && field_options_not_empty_in(:included, field_options)) ) end def excluded?(field, value = nil) (field_options = dsl_context[:fields][field]) && ( (value && field_options_is(:excluded, field_options, value)) || (!value && field_options_not_empty_in(:excluded, field_options)) ) end private def field_options_is(type, field_options, value) (values = field_options[type]) && values.include?(value) end def field_options_not_empty_in(type, field_options) field_options[type] && !field_options[type].empty? end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems