Class: SmartCore::Schema

Inherits:
Object
  • Object
show all
Includes:
DSL
Defined in:
lib/smart_core/schema.rb,
lib/smart_core/schema/errors.rb,
lib/smart_core/schema/version.rb

Overview

rubocop:disable Style/StaticClass

Since:

  • 0.1.0

Defined Under Namespace

Modules: DSL, KeyControl Classes: Checker, Result

Constant Summary collapse

Error =

Since:

  • 0.1.0

Class.new(SmartCore::Error)
ArgumentError =

Since:

  • 0.1.0

Class.new(SmartCore::ArgumentError)
VERSION =

Returns:

  • (String)

Since:

  • 0.1.0

Version:

  • 0.11.0

'0.11.0'

Instance Method Summary collapse

Methods included from DSL

included

Instance Method Details

#valid?(verifiable_hash) ⇒ Boolean

Parameters:

  • verifiable_hash (Hash<String|Symbol,Any>)

Returns:

  • (Boolean)

Since:

  • 0.1.0



29
30
31
# File 'lib/smart_core/schema.rb', line 29

def valid?(verifiable_hash)
  validate(verifiable_hash).success?
end

#validate(verifiable_hash) ⇒ SmartCore::Schema::Result

Parameters:

  • verifiable_hash (Hash<String|Symbol,Any>)

Returns:

Since:

  • 0.1.0



38
39
40
# File 'lib/smart_core/schema.rb', line 38

def validate(verifiable_hash)
  schema_checker.check!(verifiable_hash)
end