Class: Vissen::Parameterized::Value::Real

Inherits:
Object
  • Object
show all
Includes:
Vissen::Parameterized::Value
Defined in:
lib/vissen/parameterized/value/real.rb

Overview

Real values are stored as floats internally.

Usage

real = Real.new 42
real.value # => 42.0

Constant Summary collapse

DEFAULT =

Returns see Value.

Returns:

  • (Float)

    see Value

0.0

Instance Attribute Summary

Attributes included from Vissen::Parameterized::Value

#value

Instance Method Summary collapse

Methods included from Vissen::Parameterized::Value

canonicalize, #initialize, #scope, #tainted?, #to_s, types, #untaint!

Instance Method Details

#write(new_value) ⇒ Object

Returns see Value#write.

Parameters:

  • new_value (#to_f)

    the new value.

Returns:

  • see Value#write

Raises:

  • (TypeError)

    if the given object cannot be coerced into a float.



24
25
26
# File 'lib/vissen/parameterized/value/real.rb', line 24

def write(new_value)
  super Float(new_value)
end