Module: Fmt
- Defined in:
- lib/fmt.rb,
lib/fmt/node.rb,
lib/fmt/token.rb,
lib/fmt/sigils.rb,
lib/fmt/version.rb,
lib/fmt/renderer.rb,
lib/fmt/lru_cache.rb,
lib/fmt/tokenizer.rb,
lib/fmt/models/embed.rb,
lib/fmt/models/macro.rb,
lib/fmt/models/model.rb,
lib/fmt/parsers/parser.rb,
lib/fmt/models/pipeline.rb,
lib/fmt/models/template.rb,
lib/fmt/mixins/matchable.rb,
lib/fmt/models/arguments.rb,
lib/fmt/registries/registry.rb,
lib/fmt/parsers/embed_parser.rb,
lib/fmt/parsers/macro_parser.rb,
lib/fmt/parsers/pipeline_parser.rb,
lib/fmt/parsers/template_parser.rb,
lib/fmt/parsers/arguments_parser.rb,
lib/fmt/registries/native_registry.rb,
lib/fmt/registries/rainbow_registry.rb,
lib/fmt/refinements/kernel_refinement.rb
Overview
rbs_inline: enabled
Defined Under Namespace
Modules: KernelRefinement, Matchable Classes: Arguments, ArgumentsParser, Embed, EmbedParser, Error, FormatError, LRUCache, Macro, MacroParser, Model, NativeRegistry, Node, Parser, Pipeline, PipelineParser, RainbowRegistry, Registry, Renderer, Sigils, Template, TemplateParser, Token, Tokenizer
Constant Summary collapse
- VERSION =
"0.3.5"
Class Method Summary collapse
-
.register ⇒ Object
Adds a keypair to the registry.
-
.registry ⇒ Object
Global registry for storing and retrieving String formatters i.e.
-
.unregister ⇒ Object
Deletes a keypair from the registry.
-
.with_overrides ⇒ Object
Executes a block with registry overrides.
Class Method Details
.register ⇒ Object
Adds a keypair to the registry
32 33 34 |
# File 'lib/fmt.rb', line 32 def register(...) registry.add(...) end |
.registry ⇒ Object
Global registry for storing and retrieving String formatters i.e. Procs
21 22 23 24 25 |
# File 'lib/fmt.rb', line 21 def registry @registry ||= LOCK.synchronize do NativeRegistry.new.merge! RainbowRegistry.new end end |
.unregister ⇒ Object
Deletes a keypair from the registry
39 40 41 |
# File 'lib/fmt.rb', line 39 def unregister(...) registry.delete(...) end |
.with_overrides ⇒ Object
Overrides will temporarily be added to the registry and will overwrite existing entries for the duration of the block Non overriden entries remain unchanged
Executes a block with registry overrides
52 53 54 |
# File 'lib/fmt.rb', line 52 def with_overrides(...) registry.with_overrides(...) end |