Class: Vim::Flavor::PlainVersion

Inherits:
Gem::Version
  • Object
show all
Defined in:
lib/vim-flavor/plainversion.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tag_name) ⇒ PlainVersion

Returns a new instance of PlainVersion.



6
7
8
9
# File 'lib/vim-flavor/plainversion.rb', line 6

def initialize(tag_name)
  @original_tag_name = tag_name
  super(self.class.normalize_tag_name(tag_name))
end

Instance Attribute Details

#original_tag_nameObject

Returns the value of attribute original_tag_name.



4
5
6
# File 'lib/vim-flavor/plainversion.rb', line 4

def original_tag_name
  @original_tag_name
end

Class Method Details

.correct?(tag_name) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/vim-flavor/plainversion.rb', line 15

def self.correct?(tag_name)
  super(normalize_tag_name(tag_name))
end

.normalize_tag_name(tag_name) ⇒ Object



11
12
13
# File 'lib/vim-flavor/plainversion.rb', line 11

def self.normalize_tag_name(tag_name)
  tag_name.to_s.sub(/^v/, '')
end

Instance Method Details

#to_revisionObject



23
24
25
# File 'lib/vim-flavor/plainversion.rb', line 23

def to_revision()
  to_s
end

#to_sObject



19
20
21
# File 'lib/vim-flavor/plainversion.rb', line 19

def to_s()
  @original_tag_name
end