Class: Predicator::Predicates::Not

Inherits:
Object
  • Object
show all
Defined in:
lib/predicator/predicates/not.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(predicate) ⇒ Not

Returns a new instance of Not.



6
7
8
# File 'lib/predicator/predicates/not.rb', line 6

def initialize predicate
  @predicate = predicate
end

Instance Attribute Details

#predicateObject (readonly)

Returns the value of attribute predicate.



4
5
6
# File 'lib/predicator/predicates/not.rb', line 4

def predicate
  @predicate
end

Instance Method Details

#==(other) ⇒ Object



14
15
16
17
# File 'lib/predicator/predicates/not.rb', line 14

def == other
  other.kind_of?(self.class) &&
    other.predicate == predicate
end

#satisfied?(context = Predicator::Context.new) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/predicator/predicates/not.rb', line 10

def satisfied? context=Predicator::Context.new
  !predicate.satisfied? context
end