Class: Rosette::Core::Remote

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

Constant Summary

Constants inherited from Ref

Rosette::Core::Ref::DELIMITER

Instance Attribute Summary collapse

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(remote, name) ⇒ Remote

Returns a new instance of Remote.


61
62
63
64
# File 'lib/rosette/core/git/ref.rb', line 61

def initialize(remote, name)
  @remote = remote
  @name = name
end

Instance Attribute Details

#remoteObject (readonly)

Returns the value of attribute remote


59
60
61
# File 'lib/rosette/core/git/ref.rb', line 59

def remote
  @remote
end

Class Method Details

.create_from(chunks) ⇒ Object


53
54
55
56
57
# File 'lib/rosette/core/git/ref.rb', line 53

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

Instance Method Details

#to_sObject


70
71
72
# File 'lib/rosette/core/git/ref.rb', line 70

def to_s
  "refs/remotes/#{remote}/#{name}"
end

#typeObject


66
67
68
# File 'lib/rosette/core/git/ref.rb', line 66

def type
  :remote
end