Sha256: 5e8591b463d84233dacb8abf127ddcc6b148bab568c7646ede061be9a2b26669

Contents?: true

Size: 364 Bytes

Versions: 8

Compression:

Stored size: 364 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,nil]
        def self.to_decimal(input)
          input.to_d unless empty_str?(input)
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
dry-types-0.12.1 lib/dry/types/coercions/json.rb
dry-types-0.12.0 lib/dry/types/coercions/json.rb
dry-types-0.11.1 lib/dry/types/coercions/json.rb
dry-types-0.11.0 lib/dry/types/coercions/json.rb
dry-types-0.10.3 lib/dry/types/coercions/json.rb
dry-types-0.10.2 lib/dry/types/coercions/json.rb
dry-types-0.10.1 lib/dry/types/coercions/json.rb
dry-types-0.10.0 lib/dry/types/coercions/json.rb