Module: NxtSchema

Extended by:
Dsl
Defined in:
lib/nxt_schema.rb,
lib/nxt_schema/dsl.rb,
lib/nxt_schema/node.rb,
lib/nxt_schema/error.rb,
lib/nxt_schema/types.rb,
lib/nxt_schema/version.rb,
lib/nxt_schema/callable.rb,
lib/nxt_schema/registry.rb,
lib/nxt_schema/node/base.rb,
lib/nxt_schema/node/leaf.rb,
lib/nxt_schema/undefined.rb,
lib/nxt_schema/node/any_of.rb,
lib/nxt_schema/node/schema.rb,
lib/nxt_schema/template/base.rb,
lib/nxt_schema/template/leaf.rb,
lib/nxt_schema/errors/invalid.rb,
lib/nxt_schema/registry/proxy.rb,
lib/nxt_schema/node/collection.rb,
lib/nxt_schema/template/any_of.rb,
lib/nxt_schema/template/schema.rb,
lib/nxt_schema/node/error_store.rb,
lib/nxt_schema/validators/query.rb,
lib/nxt_schema/template/sub_nodes.rb,
lib/nxt_schema/validators/pattern.rb,
lib/nxt_schema/template/collection.rb,
lib/nxt_schema/validators/equal_to.rb,
lib/nxt_schema/validators/excludes.rb,
lib/nxt_schema/validators/includes.rb,
lib/nxt_schema/validators/registry.rb,
lib/nxt_schema/validators/attribute.rb,
lib/nxt_schema/validators/less_than.rb,
lib/nxt_schema/validators/validator.rb,
lib/nxt_schema/errors/coercion_error.rb,
lib/nxt_schema/template/on_evaluator.rb,
lib/nxt_schema/errors/invalid_options.rb,
lib/nxt_schema/template/has_sub_nodes.rb,
lib/nxt_schema/template/type_resolver.rb,
lib/nxt_schema/validators/excluded_in.rb,
lib/nxt_schema/validators/included_in.rb,
lib/nxt_schema/validators/greater_than.rb,
lib/nxt_schema/node/errors/schema_error.rb,
lib/nxt_schema/template/maybe_evaluator.rb,
lib/nxt_schema/validators/optional_node.rb,
lib/nxt_schema/validators/error_messages.rb,
lib/nxt_schema/node/errors/validation_error.rb,
lib/nxt_schema/template/type_system_resolver.rb,
lib/nxt_schema/validators/less_than_or_equal.rb,
lib/nxt_schema/validators/validate_with_proxy.rb,
lib/nxt_schema/validators/greater_than_or_equal.rb

Defined Under Namespace

Modules: Dsl, Errors, Node, Registry, Template, Types, Validator, Validators Classes: Callable, Error, Undefined

Constant Summary collapse

VERSION =
"1.0.2"

Constants included from Dsl

Dsl::DEFAULT_OPTIONS

Class Method Summary collapse

Methods included from Dsl

any_of, collection, params, schema

Class Method Details

.register_error_messages(*paths) ⇒ Object



62
63
64
# File 'lib/nxt_schema.rb', line 62

def register_error_messages(*paths)
  Validators::ErrorMessages.load(paths)
end

.register_type(key, type) ⇒ Object



70
71
72
# File 'lib/nxt_schema.rb', line 70

def register_type(key, type)
  NxtSchema::Types.registry(:types).register(key, type)
end

.register_validator(validator, *keys) ⇒ Object



66
67
68
# File 'lib/nxt_schema.rb', line 66

def register_validator(validator, *keys)
  keys.each { |key| NxtSchema::Validators::REGISTRY.register(key, validator) }
end