Class: Dumbstats::Value

Inherits:
Struct
  • Object
show all
Includes:
Comparable
Defined in:
lib/dumbstats/value.rb

Overview

A value that associates a numeric value with an aribitrary object.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#objectObject

Returns the value of attribute object

Returns:

  • (Object)

    the current value of object



3
4
5
# File 'lib/dumbstats/value.rb', line 3

def object
  @object
end

#valueObject Also known as: to_numeric

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



3
4
5
# File 'lib/dumbstats/value.rb', line 3

def value
  @value
end

Instance Method Details

#<=>(x) ⇒ Object



5
6
7
# File 'lib/dumbstats/value.rb', line 5

def <=> x
  value <=> x.value
end