Class: Vissen::Parameterized::Value::Int

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

Overview

Int values are stored as Fixnums internally.

Usage

int = Int.new 42
int.value # => 42

Constant Summary collapse

DEFAULT =

Returns see Value.

Returns:

  • (Fixnum)

    see Value

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_i)

    the new value.

Returns:

  • see Value#write

Raises:

  • (TypeError)

    if the given object cannot be coerced into an integer.



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

def write(new_value)
  super Integer(new_value)
end