Class: Predicator::Predicates::Not
- Inherits:
-
Object
- Object
- Predicator::Predicates::Not
- Defined in:
- lib/predicator/predicates/not.rb
Instance Attribute Summary collapse
-
#predicate ⇒ Object
readonly
Returns the value of attribute predicate.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(predicate) ⇒ Not
constructor
A new instance of Not.
- #satisfied?(context = Predicator::Context.new) ⇒ Boolean
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
#predicate ⇒ Object (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
10 11 12 |
# File 'lib/predicator/predicates/not.rb', line 10 def satisfied? context=Predicator::Context.new !predicate.satisfied? context end |