Class: Timedelta::SafeInteger
- Inherits:
-
Object
- Object
- Timedelta::SafeInteger
- Defined in:
- lib/units-time/timedelta.rb
Overview
note: safe integer used for coerce dispatch
Instance Method Summary collapse
-
#*(other) ⇒ Object
it’s safe to swap left and right for multiplication (it’s communicative).
-
#initialize(value) ⇒ SafeInteger
constructor
A new instance of SafeInteger.
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 |