Module: Dry::Schema::Messages Private
- Defined in:
- lib/dry/schema/messages.rb,
lib/dry/schema/messages/abstract.rb,
lib/dry/schema/messages/template.rb,
lib/dry/schema/messages/namespaced.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
An API for configuring message backends
Defined Under Namespace
Classes: Abstract, I18n, Namespaced, Template, YAML
Class Method Summary collapse
- .build(config) ⇒ Object private
- .default ⇒ Object private
- .setup(config) ⇒ Object private
Class Method Details
.build(config) ⇒ 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.
22 23 24 25 26 27 28 29 |
# File 'lib/dry/schema/messages.rb', line 22 def self.build(config) case config. when :yaml then default when :i18n then Messages::I18n.new else raise "+#{config.}+ is not a valid messages identifier" end end |
.default ⇒ 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.
32 33 34 |
# File 'lib/dry/schema/messages.rb', line 32 def self.default Messages::YAML.load end |
.setup(config) ⇒ 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.
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/dry/schema/messages.rb', line 7 def self.setup(config) = build(config) if config. && config.namespace .merge(config.).namespaced(config.namespace) elsif config. .merge(config.) elsif config.namespace .namespaced(config.namespace) else end end |