class Elasticband::Filter::Not

Attributes

options[RW]
other_filter[RW]

Public Class Methods

new(other_filter, options = {}) click to toggle source
# File lib/elasticband/filter/not.rb, line 6
def initialize(other_filter, options = {})
  self.other_filter = other_filter
  self.options = options
end

Public Instance Methods

to_h() click to toggle source
# File lib/elasticband/filter/not.rb, line 11
def to_h
  { not: filter_hash }
end

Private Instance Methods

filter_hash() click to toggle source
# File lib/elasticband/filter/not.rb, line 17
def filter_hash
  return other_filter.to_h if options.blank?

  { filter: other_filter.to_h }.merge!(options)
end