Class: Gitrb::Tag
Instance Attribute Summary collapse
-
#message ⇒ Object
Returns the value of attribute message.
-
#object ⇒ Object
Returns the value of attribute object.
-
#tagger ⇒ Object
Returns the value of attribute tagger.
-
#tagtype ⇒ Object
Returns the value of attribute tagtype.
Attributes inherited from GitObject
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Tag
constructor
A new instance of Tag.
- #parse(data) ⇒ Object
Methods inherited from GitObject
#==, factory, #git_object, inherited
Constructor Details
#initialize(options = {}) ⇒ Tag
Returns a new instance of Tag.
6 7 8 9 |
# File 'lib/gitrb/tag.rb', line 6 def initialize( = {}) super() parse([:data]) if [:data] end |
Instance Attribute Details
#message ⇒ Object
Returns the value of attribute message.
4 5 6 |
# File 'lib/gitrb/tag.rb', line 4 def @message end |
#object ⇒ Object
Returns the value of attribute object.
4 5 6 |
# File 'lib/gitrb/tag.rb', line 4 def object @object end |
#tagger ⇒ Object
Returns the value of attribute tagger.
4 5 6 |
# File 'lib/gitrb/tag.rb', line 4 def tagger @tagger end |
#tagtype ⇒ Object
Returns the value of attribute tagtype.
4 5 6 |
# File 'lib/gitrb/tag.rb', line 4 def tagtype @tagtype end |
Instance Method Details
#parse(data) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/gitrb/tag.rb', line 11 def parse(data) headers, @message = data.split("\n\n", 2) repository.set_encoding(@message) headers.split("\n").each do |header| key, value = header.split(' ', 2) case key when 'type' @tagtype = value when 'object' @object = Reference.new(:repository => repository, :id => repository.set_encoding(value)) when 'tagger' @tagger = User.parse(repository.set_encoding(value)) end end self end |