Class: Logica::Predicates::AdHoc
- Defined in:
- lib/logica/predicates/ad_hoc.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, &definition) ⇒ AdHoc
constructor
A new instance of AdHoc.
- #name_and_attributes ⇒ Object
Methods inherited from Base
#and, #and_not, #arity, #disjoint_with?, #exhaustive_with?, #generalization_of?, #generalization_of_negation_of?, #generalization_of_other?, #iff, #implies, #method_missing, #negated, #or, #or_not, #partially_applied_with, #portion_satisfied_by, predicate_factory, #remainder_unsatisfied_by, #respond_to_missing?, #specialization_of?, #to_method, #to_proc, #to_s, #unsatisfied_by?, #xor
Methods included from ComparableByState
Constructor Details
#initialize(name, &definition) ⇒ AdHoc
Returns a new instance of AdHoc.
6 7 8 9 |
# File 'lib/logica/predicates/ad_hoc.rb', line 6 def initialize(name, &definition) @name = name define_singleton_method :satisfied_by?, &definition end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Logica::Predicates::Base
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/logica/predicates/ad_hoc.rb', line 4 def name @name end |
Instance Method Details
#name_and_attributes ⇒ Object
11 12 13 |
# File 'lib/logica/predicates/ad_hoc.rb', line 11 def name_and_attributes "#{name}()" end |