Class: Gitlab::Git::Tag

Inherits:
Ref
  • Object
show all
Defined in:
lib/gitlab_git/tag.rb

Constant Summary

Constants included from EncodingHelper

EncodingHelper::ENCODING_CONFIDENCE_THRESHOLD

Instance Attribute Summary collapse

Attributes inherited from Ref

#name, #target

Instance Method Summary collapse

Methods inherited from Ref

dereference_object, extract_branch_name

Methods included from EncodingHelper

#encode!, #encode_utf8

Constructor Details

#initialize(repository, object, name, target, message = nil) ⇒ Tag

Returns a new instance of Tag.



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/gitlab_git/tag.rb', line 6

def initialize(repository, object, name, target, message = nil)
  super(repository, name, target)
  @object_sha = if object.respond_to?(:oid)
                  object.oid
                elsif object.respond_to?(:name)
                  object.name
                elsif object.is_a? String
                  object
                else
                  nil
                end
  @message = message
end

Instance Attribute Details

#object_shaObject (readonly)

Returns the value of attribute object_sha.



4
5
6
# File 'lib/gitlab_git/tag.rb', line 4

def object_sha
  @object_sha
end

Instance Method Details

#messageObject



20
21
22
# File 'lib/gitlab_git/tag.rb', line 20

def message
  encode! @message
end