Class: Feature::Operation::Not

Inherits:
Object
  • Object
show all
Defined in:
lib/toggles/feature/operation/not.rb

Class Method Summary collapse

Class Method Details

.call(entity, attr_name, expected) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/toggles/feature/operation/not.rb', line 4

def self.call(entity, attr_name, expected)
  if expected.kind_of? Hash
    expected.none? do |operation, value|
      OPERATIONS[operation.to_sym].call(entity, attr_name, value)
    end
  else
    entity.send(attr_name) != expected
  end
end