Sha256: 8dc5e9dd1cfededafd4e05bb388f00768d427ebcad18a2e2bdeec6e0068b35a1

Contents?: true

Size: 643 Bytes

Versions: 2

Compression:

Stored size: 643 Bytes

Contents

class StrongJSON
  module Types
    def object(fields = {})
      Type::Object.new(fields)
    end

    def array(type = any)
      Type::Array.new(type)
    end

    def optional(type = any)
      Type::Optional.new(type)
    end

    def string
      StrongJSON::Type::Base.new(:string)
    end

    def numeric
      StrongJSON::Type::Base.new(:numeric)
    end

    def number
      StrongJSON::Type::Base.new(:number)
    end

    def boolean
      StrongJSON::Type::Base.new(:boolean)
    end

    def any
      StrongJSON::Type::Base.new(:any)
    end

    def prohibited
      StrongJSON::Type::Base.new(:prohibited)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
strong_json-0.0.2 lib/strong_json/types.rb
strong_json-0.0.1 lib/strong_json/types.rb