Class: Dry::Types::PredicateRegistry Private

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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_predicateObject (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

#predicatesObject (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.

Returns:

  • (Boolean)


24
25
26
# File 'lib/dry/types/predicate_registry.rb', line 24

def key?(name)
  KERNEL_RESPOND_TO.bind_call(@predicates, name)
end