Class: Languages::Generic::Dots
- Inherits:
-
Object
- Object
- Languages::Generic::Dots
- Defined in:
- lib/languages/generic/dots.rb
Instance Method Summary collapse
- #+(other) ⇒ Object
- #-(other) ⇒ Object
- #==(other) ⇒ Object
-
#initialize(int) ⇒ Dots
constructor
A new instance of Dots.
- #to_dots ⇒ Object
- #to_i ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(int) ⇒ Dots
Returns a new instance of Dots.
4 5 6 |
# File 'lib/languages/generic/dots.rb', line 4 def initialize(int) @int = int end |
Instance Method Details
#+(other) ⇒ Object
12 13 14 |
# File 'lib/languages/generic/dots.rb', line 12 def +(other) self.class.new(@int + value_of(other)) end |
#-(other) ⇒ Object
16 17 18 |
# File 'lib/languages/generic/dots.rb', line 16 def -(other) self.class.new(@int - value_of(other)) end |
#==(other) ⇒ Object
20 21 22 |
# File 'lib/languages/generic/dots.rb', line 20 def ==(other) @int == value_of(other) end |
#to_dots ⇒ Object
24 25 26 |
# File 'lib/languages/generic/dots.rb', line 24 def to_dots self end |
#to_i ⇒ Object
8 9 10 |
# File 'lib/languages/generic/dots.rb', line 8 def to_i @int end |
#to_s ⇒ Object
28 29 30 |
# File 'lib/languages/generic/dots.rb', line 28 def to_s @int.to_s end |