Class: ReeMapper::FieldsFilter::ExceptStrategy

Inherits:
Object
  • Object
show all
Defined in:
lib/ree_lib/packages/ree_mapper/package/ree_mapper/fields_filter.rb

Instance Method Summary collapse

Constructor Details

#initialize(except) ⇒ ExceptStrategy

Returns a new instance of ExceptStrategy.



40
41
42
43
44
45
46
47
48
# File 'lib/ree_lib/packages/ree_mapper/package/ree_mapper/fields_filter.rb', line 40

def initialize(except)
  @fields = Set.new

  except&.each do |item|
    if item.is_a? Symbol
      @fields << item
    end
  end
end

Instance Method Details

#allow?(field) ⇒ Boolean

Returns:

  • (Boolean)


50
51
52
# File 'lib/ree_lib/packages/ree_mapper/package/ree_mapper/fields_filter.rb', line 50

def allow?(field)
  !fields.include?(field)
end