Class: Timedelta::SafeInteger

Inherits:
Object
  • Object
show all
Defined in:
lib/units-time/timedelta.rb

Overview

note: safe integer used for coerce dispatch

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ SafeInteger

Returns a new instance of SafeInteger.



57
58
59
# File 'lib/units-time/timedelta.rb', line 57

def initialize( value )
  @value = value
end

Instance Method Details

#*(other) ⇒ Object

it’s safe to swap left and right for multiplication (it’s communicative)



61
# File 'lib/units-time/timedelta.rb', line 61

def *( other ) other.*( @value ); end