Module: SEPA::SchemaValidation
- Extended by:
- ActiveSupport::Concern
- Included in:
- Message
- Defined in:
- lib/sepa_rator/concerns/schema_validation.rb
Constant Summary collapse
- DEFAULT_SCHEMA_ROOT =
File.('../../schema', __dir__).freeze
- SCHEMA_GEMS =
So missing-schema errors can name the companion gem to install.
{ 'at' => 'sepa_rator-at', 'dk' => 'sepa_rator-dk', 'sps' => 'sepa_rator-sps' }.freeze
- SCHEMA_CACHE =
Keyed by resolved absolute path so a late-registered root takes effect immediately.
{}
- SCHEMA_CACHE_MUTEX =
rubocop:disable Style/MutableConstant – intentional cache
Mutex.new
Class Method Summary collapse
Class Method Details
.register_schema_root(path) ⇒ Object
22 23 24 25 26 27 |
# File 'lib/sepa_rator/concerns/schema_validation.rb', line 22 def register_schema_root(path) = File.(path) raise ArgumentError, "register_schema_root: #{} is not a directory" unless File.directory?() schema_roots.unshift() unless schema_roots.include?() end |
.schema_roots ⇒ Object
18 19 20 |
# File 'lib/sepa_rator/concerns/schema_validation.rb', line 18 def schema_roots @schema_roots ||= [DEFAULT_SCHEMA_ROOT] end |