Sha256: 5a7ab0067763123cd4834b061762f2524a64788d72d07a0f7e46d8c895e9139d

Contents?: true

Size: 538 Bytes

Versions: 2

Compression:

Stored size: 538 Bytes

Contents

# frozen_string_literal: true

module Jimmy
  class Schema
    # Define the schema that must be valid if the +if+ schema is valid.
    # @param schema [Jimmy::Schema] The +then+ schema.
    # @return [self] self, for chaining
    def then(schema)
      set then: cast_schema(schema)
    end

    # Define the schema that must be valid if the +if+ schema is not valid.
    # @param schema [Jimmy::Schema] The +else+ schema.
    # @return [self] self, for chaining
    def else(schema)
      set else: cast_schema(schema)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
jimmy-2.1.0 lib/jimmy/schema/conditions.rb
jimmy-2.0.3 lib/jimmy/schema/conditions.rb