Class: Flr::Version

Inherits:
Array
  • Object
show all
Defined in:
lib/flr/version.rb

Instance Method Summary collapse

Constructor Details

#initialize(str) ⇒ Version

Returns a new instance of Version.



9
10
11
# File 'lib/flr/version.rb', line 9

def initialize str
  super(str.split('.').map { |e| e.to_i })
end

Instance Method Details

#<(x) ⇒ Object



13
14
15
# File 'lib/flr/version.rb', line 13

def < x
  (self <=> x) < 0
end

#<=(x) ⇒ Object



31
32
33
34
35
# File 'lib/flr/version.rb', line 31

def <= x
  a = self < x
  b = self == x
  return  (a || b)
end

#==(x) ⇒ Object



21
22
23
# File 'lib/flr/version.rb', line 21

def == x
  (self <=> x) == 0
end

#>(x) ⇒ Object



17
18
19
# File 'lib/flr/version.rb', line 17

def > x
  (self <=> x) > 0
end

#>=(x) ⇒ Object



25
26
27
28
29
# File 'lib/flr/version.rb', line 25

def >= x
  a = self > x
  b = self == x
  return  (a || b)
end