Class: Rosette::Core::Tag

Inherits:
Ref
  • Object
show all
Defined in:
lib/rosette/core/git/ref.rb

Constant Summary

Constants inherited from Ref

Ref::DELIMITER

Instance Attribute Summary

Attributes inherited from Ref

#name

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Ref

#head?, inherited, parse, #remote?, #tag?

Constructor Details

#initialize(name) ⇒ Tag

Returns a new instance of Tag.


102
103
104
# File 'lib/rosette/core/git/ref.rb', line 102

def initialize(name)
  @name = name
end

Class Method Details

.create_from(chunks) ⇒ Object


96
97
98
99
100
# File 'lib/rosette/core/git/ref.rb', line 96

def self.create_from(chunks)
  if chunks.first == 'tags'
    new(chunks[1..-1].join(DELIMITER))
  end
end

Instance Method Details

#to_sObject


110
111
112
# File 'lib/rosette/core/git/ref.rb', line 110

def to_s
  "refs/tags/#{name}"
end

#typeObject


106
107
108
# File 'lib/rosette/core/git/ref.rb', line 106

def type
  :tag
end