Module: MediaInfo::VERSION

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

Overview

Probably overkill, but why. This is all a thin wrapper around the string in VERSION::STRING

Constant Summary collapse

MAJOR =

The major version number of the gem. Anything that depends on on this gem is likely to break when this changes.

1
MINOR =

The minor version number. Changes here could break external dependencies on rare occasions, but effort will be taken to avoid that. New features usually increment this value.

0
PATCH =

The patch-level version number. Changes here should never break anything, and usually represent bugfixes.

3
SIGNATURE =

The whole version number, in array form.

[MAJOR, MINOR, PATCH]
STRING =

The whole version number, in gemspec-compatible string form. When in doubt, you probably want this version.

SIGNATURE.join '.'

Delegating Into STRING collapse

Class Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args, &block) ⇒ Object (private)



56
57
58
59
# File 'lib/mediainfo/version.rb', line 56

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

Class Method Details

.<=>(other) ⇒ -1, ...

Parameters:

  • other (Types)

    description

Returns:

  • (-1)

    If 'self' sorts before 'other'

  • (0)

    If 'self' sorts equal with 'other'

  • (1)

    If 'self' sorts after 'other'



38
39
40
41
# File 'lib/mediainfo/version.rb', line 38

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

.hashInt

Returns is a thin wrapper around String.

Returns:

  • (Int)

    is a thin wrapper around String



46
47
48
# File 'lib/mediainfo/version.rb', line 46

def hash
  STRING.hash
end

.inspectString

the VERSION module itself

Returns:

  • (String)

    the version number



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

def inspect
  STRING.inspect
end

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



56
57
58
59
# File 'lib/mediainfo/version.rb', line 56

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

.respond_to?(meth) ⇒ Boolean

Parameters:

  • meth (Symbol)

    a method name

Returns:

  • (Boolean)


52
53
54
# File 'lib/mediainfo/version.rb', line 52

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

.to_sString

the VERSION module itself

Returns:

  • (String)

    the version number



32
33
34
# File 'lib/mediainfo/version.rb', line 32

def inspect
  STRING.inspect
end