Module: Sinatra::Contrib::VERSION

Extended by:
Comparable
Defined in:
lib/sinatra/contrib/version.rb

Constant Summary collapse

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

Class Method Summary collapse

Class Method Details

.<=>(other) ⇒ Object



25
26
27
28
# File 'lib/sinatra/contrib/version.rb', line 25

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

.hashObject



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

def self.hash
  STRING.hash
end

.inspectObject



30
31
32
# File 'lib/sinatra/contrib/version.rb', line 30

def self.inspect
  STRING.inspect
end

.majorObject



16
# File 'lib/sinatra/contrib/version.rb', line 16

def self.major; MAJOR  end

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



39
40
41
42
# File 'lib/sinatra/contrib/version.rb', line 39

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

.minorObject



17
# File 'lib/sinatra/contrib/version.rb', line 17

def self.minor; MINOR  end

.respond_to?(meth) ⇒ Boolean

Returns:

  • (Boolean)


34
35
36
37
# File 'lib/sinatra/contrib/version.rb', line 34

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

.tinyObject



18
# File 'lib/sinatra/contrib/version.rb', line 18

def self.tiny;  TINY   end

.to_sObject



19
# File 'lib/sinatra/contrib/version.rb', line 19

def self.to_s;  STRING end