Sha256: d5ed546188faf298e5d8e78eed3c7cba4740f0d6dab1e4d4487911131390d563

Contents?: true

Size: 361 Bytes

Versions: 2

Compression:

Stored size: 361 Bytes

Contents

require 'date'
require 'bigdecimal'
require 'bigdecimal/util'
require 'time'

module Dry
  module Types
    module Coercions
      module JSON
        extend Coercions

        # @param [#to_d, Object] input
        # @return [BigDecimal?]
        def self.to_decimal(input)
          input.to_d unless empty_str?(input)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dry-types-0.9.4 lib/dry/types/coercions/json.rb
dry-types-0.9.3 lib/dry/types/coercions/json.rb