Class: SuperDiff::GemVersion
- Inherits:
-
Object
- Object
- SuperDiff::GemVersion
- Defined in:
- lib/super_diff/gem_version.rb
Instance Method Summary collapse
- #<(other) ⇒ Object
- #<=(other) ⇒ Object
- #==(other) ⇒ Object
- #=~(other) ⇒ Object
- #>(other) ⇒ Object
- #>=(other) ⇒ Object
-
#initialize(version) ⇒ GemVersion
constructor
A new instance of GemVersion.
- #to_s ⇒ Object
Constructor Details
#initialize(version) ⇒ GemVersion
Returns a new instance of GemVersion.
3 4 5 |
# File 'lib/super_diff/gem_version.rb', line 3 def initialize(version) @version = Gem::Version.new(version.to_s) end |
Instance Method Details
#<(other) ⇒ Object
7 8 9 |
# File 'lib/super_diff/gem_version.rb', line 7 def <(other) compare?(:<, other) end |
#<=(other) ⇒ Object
11 12 13 |
# File 'lib/super_diff/gem_version.rb', line 11 def <=(other) compare?(:<=, other) end |
#==(other) ⇒ Object
15 16 17 |
# File 'lib/super_diff/gem_version.rb', line 15 def ==(other) compare?(:==, other) end |
#=~(other) ⇒ Object
27 28 29 |
# File 'lib/super_diff/gem_version.rb', line 27 def =~(other) Gem::Requirement.new(other).satisfied_by?(version) end |
#>(other) ⇒ Object
23 24 25 |
# File 'lib/super_diff/gem_version.rb', line 23 def >(other) compare?(:>, other) end |
#>=(other) ⇒ Object
19 20 21 |
# File 'lib/super_diff/gem_version.rb', line 19 def >=(other) compare?(:>=, other) end |
#to_s ⇒ Object
31 32 33 |
# File 'lib/super_diff/gem_version.rb', line 31 def to_s version.to_s end |