Module: Pdfrb::Arlington::Predicate::Functions
- Defined in:
- lib/pdfrb/arlington/predicate/functions.rb,
lib/pdfrb/arlington/predicate/functions/file.rb,
lib/pdfrb/arlington/predicate/functions/logical.rb,
lib/pdfrb/arlington/predicate/functions/version.rb,
lib/pdfrb/arlington/predicate/functions/presence.rb,
lib/pdfrb/arlington/predicate/functions/reference.rb,
lib/pdfrb/arlington/predicate/functions/arithmetic.rb
Overview
Registry of fn:Name predicate implementations. Each module
under Functions implements one or more predicates and
registers them on load via register.
Defined Under Namespace
Modules: ArithmeticPredicates, FilePredicates, LogicalPredicates, PresencePredicates, ReferencePredicates, VersionPredicates
Class Method Summary collapse
- .clear! ⇒ Object
-
.eager_load! ⇒ Object
Force-load all function groups so register calls fire.
- .register(name, &block) ⇒ Object
- .registry ⇒ Object
Class Method Details
.clear! ⇒ Object
29 30 31 |
# File 'lib/pdfrb/arlington/predicate/functions.rb', line 29 def clear! @registry.clear end |
.eager_load! ⇒ Object
Force-load all function groups so register calls fire. Idempotent.
35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/pdfrb/arlington/predicate/functions.rb', line 35 def eager_load! return if @eager_loaded constants.each do |c| const_get(c) rescue NameError, LoadError # Skip autoload targets that don't define a class # or whose file doesn't exist yet. end @eager_loaded = true end |
.register(name, &block) ⇒ Object
25 26 27 |
# File 'lib/pdfrb/arlington/predicate/functions.rb', line 25 def register(name, &block) @registry[name.to_s] = block end |
.registry ⇒ Object
20 21 22 23 |
# File 'lib/pdfrb/arlington/predicate/functions.rb', line 20 def registry eager_load! unless @eager_loaded @registry end |