Class: Temporal::Units::Base
- Inherits:
-
Object
- Object
- Temporal::Units::Base
- Includes:
- Comparable
- Defined in:
- lib/temporal/units/base.rb
Instance Method Summary collapse
- #+(other) ⇒ Object
- #-(other) ⇒ Object
- #<=>(other) ⇒ Object
- #==(other) ⇒ Object
-
#initialize(value) ⇒ Base
constructor
A new instance of Base.
- #inspect ⇒ Object
- #to_f ⇒ Object
- #to_i ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(value) ⇒ Base
Returns a new instance of Base.
7 8 9 |
# File 'lib/temporal/units/base.rb', line 7 def initialize(value) self.value = value end |
Instance Method Details
#+(other) ⇒ Object
15 |
# File 'lib/temporal/units/base.rb', line 15 def +(other) = self.class.new(@value + other) |
#-(other) ⇒ Object
17 |
# File 'lib/temporal/units/base.rb', line 17 def -(other) = self.class.new(@value - other) |
#<=>(other) ⇒ Object
11 |
# File 'lib/temporal/units/base.rb', line 11 def <=>(other) = @value <=> other |
#==(other) ⇒ Object
13 |
# File 'lib/temporal/units/base.rb', line 13 def ==(other) = @value == other |
#inspect ⇒ Object
25 26 27 |
# File 'lib/temporal/units/base.rb', line 25 def inspect "<#{self.class} @value=#{@value} @reference=#{@reference}>" end |
#to_f ⇒ Object
23 |
# File 'lib/temporal/units/base.rb', line 23 def to_f = @value.to_f |
#to_i ⇒ Object
21 |
# File 'lib/temporal/units/base.rb', line 21 def to_i = @value.to_i |
#to_s ⇒ Object
19 |
# File 'lib/temporal/units/base.rb', line 19 def to_s = @value.to_s |