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.



80
81
82
# File 'lib/units-time/timedelta.rb', line 80

def initialize( value )
  @value = value
end

Instance Method Details

#*(other) ⇒ Object

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



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

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