Sha256: cd1d125c4a70d07147109ce702bc7121cff853ada986926cb7760bf010cb0891

Contents?: true

Size: 733 Bytes

Versions: 26

Compression:

Stored size: 733 Bytes

Contents

require 'dry/types/coercions/json'

module Dry
  module Types
    register('json.nil') do
      self['nil'].constructor(Coercions::JSON.method(:to_nil))
    end

    register('json.date') do
      self['date'].constructor(Coercions::JSON.method(:to_date))
    end

    register('json.date_time') do
      self['date_time'].constructor(Coercions::JSON.method(:to_date_time))
    end

    register('json.time') do
      self['time'].constructor(Coercions::JSON.method(:to_time))
    end

    register('json.decimal') do
      self['decimal'].constructor(Coercions::JSON.method(:to_decimal))
    end

    register('json.array') do
      self['array'].safe
    end

    register('json.hash') do
      self['hash'].safe
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
dry-types-0.14.1 lib/dry/types/json.rb
dry-types-0.14.0 lib/dry/types/json.rb
dry-types-0.13.4 lib/dry/types/json.rb
dry-types-0.13.3 lib/dry/types/json.rb
dry-types-0.12.3 lib/dry/types/json.rb
dry-types-0.13.2 lib/dry/types/json.rb
dry-types-0.13.1 lib/dry/types/json.rb
dry-types-0.13.0 lib/dry/types/json.rb
dry-types-0.12.2 lib/dry/types/json.rb
dry-types-0.12.1 lib/dry/types/json.rb
dry-types-0.12.0 lib/dry/types/json.rb
dry-types-0.11.1 lib/dry/types/json.rb
dry-types-0.11.0 lib/dry/types/json.rb
dry-types-0.10.3 lib/dry/types/json.rb
dry-types-0.10.2 lib/dry/types/json.rb
dry-types-0.10.1 lib/dry/types/json.rb
dry-types-0.10.0 lib/dry/types/json.rb
dry-types-0.9.4 lib/dry/types/json.rb
dry-types-0.9.3 lib/dry/types/json.rb
dry-types-0.9.2 lib/dry/types/json.rb