Module: Unpatched::VERSION

Extended by:
Comparable
Defined in:
lib/unpatched/version.rb

Constant Summary collapse

MAJOR =
0
MINOR =
0
TINY =
1
SIGNATURE =
[MAJOR, MINOR, TINY]
STRING =
SIGNATURE.join '.'

Class Method Summary collapse

Class Method Details

.<=>(other) ⇒ Object



24
25
26
27
# File 'lib/unpatched/version.rb', line 24

def self.<=>(other)
  other = other.split('.').map { |i| i.to_i } if other.respond_to? :split
  SIGNATURE <=> Array(other)
end

.hashObject



20
21
22
# File 'lib/unpatched/version.rb', line 20

def self.hash
  STRING.hash
end

.inspectObject



29
30
31
# File 'lib/unpatched/version.rb', line 29

def self.inspect
  STRING.inspect
end

.majorObject



15
# File 'lib/unpatched/version.rb', line 15

def self.major; MAJOR  end

.method_missing(meth, *args, &block) ⇒ Object



37
38
39
40
# File 'lib/unpatched/version.rb', line 37

def self.method_missing(meth, *args, &block)
  return super unless STRING.respond_to?(meth)
  STRING.send(meth, *args, &block)
end

.minorObject



16
# File 'lib/unpatched/version.rb', line 16

def self.minor; MINOR  end

.respond_to?(meth) ⇒ Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/unpatched/version.rb', line 33

def self.respond_to?(meth, *)
  meth.to_s !~ /^__|^to_str$/ and STRING.respond_to? meth unless super
end

.tinyObject



17
# File 'lib/unpatched/version.rb', line 17

def self.tiny;  TINY   end

.to_sObject



18
# File 'lib/unpatched/version.rb', line 18

def self.to_s;  STRING end