module DependencyManager::ConfigSchemaMacros::ClassMethods

Public Instance Methods

validate(**configuration) click to toggle source

Runs validator

@param **configuration [Hash[Symbol, Any]]

Hash to validate with schema

@return [Dry::Validation::Result]

# File lib/dependency_manager/config_schema_macros.rb, line 69
def validate(**configuration)
  @dry_schema.call(configuration)
end
validate_with(&dry_schema) click to toggle source

Class-level macro for validations

@see dry-rb.org/gems/dry-validation

@param &dry_schema [Proc]

Dry Schema to validate with

@return [Dry::Schema]

# File lib/dependency_manager/config_schema_macros.rb, line 59
def validate_with(&dry_schema)
  @dry_schema = Dry::Schema.Params(&dry_schema)
end