class RSchema::Schemas::Anything

A schema that matches literally any value

@example The anything schema

schema = RSchema.define { anything }
schema.valid?(nil) #=> true
schema.valid?(6.2) #=> true
schema.valid?({ hello: Time.now }) #=> true

Public Class Methods

instance() click to toggle source
# File lib/rschema/schemas/anything.rb, line 15
def self.instance
  @instance ||= new
end

Public Instance Methods

call(value, _options) click to toggle source
# File lib/rschema/schemas/anything.rb, line 19
def call(value, _options)
  Result.success(value)
end
with_wrapped_subschemas(_wrapper) click to toggle source
# File lib/rschema/schemas/anything.rb, line 23
def with_wrapped_subschemas(_wrapper)
  self
end