Class: Rosette::Core::Head

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) ⇒ Head

Returns a new instance of Head.


82
83
84
# File 'lib/rosette/core/git/ref.rb', line 82

def initialize(name)
  @name = name
end

Class Method Details

.create_from(chunks) ⇒ Object


76
77
78
79
80
# File 'lib/rosette/core/git/ref.rb', line 76

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

Instance Method Details

#to_sObject


90
91
92
# File 'lib/rosette/core/git/ref.rb', line 90

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

#typeObject


86
87
88
# File 'lib/rosette/core/git/ref.rb', line 86

def type
  :head
end