Sha256: cdf0f998fe3b0df2cafff95408562b1edd6dd0301cf54249a9bc50b20ecb13ca
Contents?: true
Size: 315 Bytes
Versions: 7
Compression:
Stored size: 315 Bytes
Contents
# frozen_string_literal: true # @api public # @since 0.1.0 SmartCore::Types::Value.define_type(:Float) do |type| type.define_checker do |value| value.is_a?(::Float) end type.define_caster do |value| begin Float(value) rescue ::TypeError, ::ArgumentError value.to_f end end end
Version data entries
7 entries across 7 versions & 1 rubygems