Module: NxtSchema

Extended by:
Dsl
Defined in:
lib/nxt_schema.rb,
lib/nxt_schema/dsl.rb,
lib/nxt_schema/error.rb,
lib/nxt_schema/types.rb,
lib/nxt_schema/version.rb,
lib/nxt_schema/callable.rb,
lib/nxt_schema/node/base.rb,
lib/nxt_schema/node/leaf.rb,
lib/nxt_schema/application.rb,
lib/nxt_schema/node/any_of.rb,
lib/nxt_schema/node/schema.rb,
lib/nxt_schema/missing_input.rb,
lib/nxt_schema/errors/invalid.rb,
lib/nxt_schema/node/sub_nodes.rb,
lib/nxt_schema/node/collection.rb,
lib/nxt_schema/application/base.rb,
lib/nxt_schema/application/leaf.rb,
lib/nxt_schema/validators/query.rb,
lib/nxt_schema/node/on_evaluator.rb,
lib/nxt_schema/application/any_of.rb,
lib/nxt_schema/application/schema.rb,
lib/nxt_schema/node/has_sub_nodes.rb,
lib/nxt_schema/node/type_resolver.rb,
lib/nxt_schema/validators/pattern.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/node/maybe_evaluator.rb,
lib/nxt_schema/validators/attribute.rb,
lib/nxt_schema/validators/less_than.rb,
lib/nxt_schema/validators/validator.rb,
lib/nxt_schema/application/collection.rb,
lib/nxt_schema/errors/invalid_options.rb,
lib/nxt_schema/validators/excluded_in.rb,
lib/nxt_schema/validators/included_in.rb,
lib/nxt_schema/application/error_store.rb,
lib/nxt_schema/validators/greater_than.rb,
lib/nxt_schema/validators/optional_node.rb,
lib/nxt_schema/node/type_system_resolver.rb,
lib/nxt_schema/validators/error_messages.rb,
lib/nxt_schema/validators/less_than_or_equal.rb,
lib/nxt_schema/validators/validate_with_proxy.rb,
lib/nxt_schema/application/errors/schema_error.rb,
lib/nxt_schema/validators/greater_than_or_equal.rb,
lib/nxt_schema/application/errors/validation_error.rb

Defined Under Namespace

Modules: Application, Dsl, Errors, Node, Types, Validator, Validators Classes: Callable, Error, MissingInput

Constant Summary collapse

VERSION =
"1.0.0"

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



59
60
61
# File 'lib/nxt_schema.rb', line 59

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

.register_type(key, type) ⇒ Object



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

def register_type(key, type)
  NxtSchema::Types.const_set(key.to_s, type)
end

.register_validator(validator, *keys) ⇒ Object



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

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