Class: SuperDiff::Core::GemVersion
- Inherits:
-
Object
- Object
- SuperDiff::Core::GemVersion
- Defined in:
- lib/super_diff/core/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.
6 7 8 |
# File 'lib/super_diff/core/gem_version.rb', line 6 def initialize(version) @version = Gem::Version.new(version.to_s) end |
Instance Method Details
#<(other) ⇒ Object
10 11 12 |
# File 'lib/super_diff/core/gem_version.rb', line 10 def <(other) compare?(:<, other) end |
#<=(other) ⇒ Object
14 15 16 |
# File 'lib/super_diff/core/gem_version.rb', line 14 def <=(other) compare?(:<=, other) end |
#==(other) ⇒ Object
18 19 20 |
# File 'lib/super_diff/core/gem_version.rb', line 18 def ==(other) compare?(:==, other) end |
#=~(other) ⇒ Object
30 31 32 |
# File 'lib/super_diff/core/gem_version.rb', line 30 def =~(other) Gem::Requirement.new(other).satisfied_by?(version) end |
#>(other) ⇒ Object
26 27 28 |
# File 'lib/super_diff/core/gem_version.rb', line 26 def >(other) compare?(:>, other) end |
#>=(other) ⇒ Object
22 23 24 |
# File 'lib/super_diff/core/gem_version.rb', line 22 def >=(other) compare?(:>=, other) end |
#to_s ⇒ Object
34 35 36 |
# File 'lib/super_diff/core/gem_version.rb', line 34 def to_s version.to_s end |