class DTOSchema::Checks::CheckReference

A dynamic reference to a custom Check

Public Class Methods

new(schema, ref, args = nil) click to toggle source
# File lib/dto_schema/checks.rb, line 27
def initialize (schema, ref, args = nil)
  @schema, @ref = schema, ref
  @args = args
end

Public Instance Methods

resolve() click to toggle source

Get the referent check

# File lib/dto_schema/checks.rb, line 38
def resolve
  @schema.resolve_check @ref
end
validate(data, args = nil) click to toggle source

Validate attribute value

# File lib/dto_schema/checks.rb, line 33
def validate (data, args = nil)
  resolve.validate data, args
end