Sha256: 76f3bab487ed1ed214ddd5a16080fa229184a13abcac63c49633013928d694b0

Contents?: true

Size: 289 Bytes

Versions: 4

Compression:

Stored size: 289 Bytes

Contents

class Typero::FloatType < Typero::Type

  def set
    @value = @value.to_f
  end

  def validate
    raise TypeError, "min lenght is #{@opts[:min]}" if @opts[:min] && value < @opts[:min]
    raise TypeError, "max lenght is #{@opts[:max]}" if @opts[:max] && value > @opts[:max]
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
typero-0.3.6 ./lib/typero/type/float.rb
typero-0.3.4 ./lib/typero/type/float.rb
typero-0.3.2 ./lib/typero/type/float.rb
typero-0.3.0 ./lib/typero/type/float.rb