Class: Languages::Generic::Dots

Inherits:
Object
  • Object
show all
Defined in:
lib/languages/generic/dots.rb

Instance Method Summary collapse

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_dotsObject



24
25
26
# File 'lib/languages/generic/dots.rb', line 24

def to_dots
  self
end

#to_iObject



8
9
10
# File 'lib/languages/generic/dots.rb', line 8

def to_i
  @int
end

#to_sObject



28
29
30
# File 'lib/languages/generic/dots.rb', line 28

def to_s
  @int.to_s
end