Class: Dry::Types::PredicateRegistry Private
- Inherits:
-
Object
- Object
- Dry::Types::PredicateRegistry
- Defined in:
- lib/dry/types/predicate_registry.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
A registry with predicate objects from ‘Dry::Logic::Predicates`
Instance Attribute Summary collapse
- #has_predicate ⇒ Object readonly private
- #predicates ⇒ Object readonly private
Instance Method Summary collapse
- #[](name) ⇒ Object private
-
#initialize(predicates = Logic::Predicates) ⇒ PredicateRegistry
constructor
private
A new instance of PredicateRegistry.
- #key?(name) ⇒ Boolean private
Constructor Details
#initialize(predicates = Logic::Predicates) ⇒ PredicateRegistry
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of PredicateRegistry.
19 20 21 |
# File 'lib/dry/types/predicate_registry.rb', line 19 def initialize(predicates = Logic::Predicates) @predicates = predicates end |
Instance Attribute Details
#has_predicate ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
13 14 15 |
# File 'lib/dry/types/predicate_registry.rb', line 13 def has_predicate @has_predicate end |
#predicates ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
10 11 12 |
# File 'lib/dry/types/predicate_registry.rb', line 10 def predicates @predicates end |
Instance Method Details
#[](name) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
29 30 31 |
# File 'lib/dry/types/predicate_registry.rb', line 29 def [](name) predicates[name] end |
#key?(name) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
24 25 26 |
# File 'lib/dry/types/predicate_registry.rb', line 24 def key?(name) KERNEL_RESPOND_TO.bind_call(@predicates, name) end |