Class: Rosette::Core::Ref
- Inherits:
-
Object
- Object
- Rosette::Core::Ref
- Defined in:
- lib/rosette/core/git/ref.rb
Constant Summary collapse
- DELIMITER =
'/'
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
37 38 39 |
# File 'lib/rosette/core/git/ref.rb', line 37 def name @name end |
Class Method Details
.inherited(subclass) ⇒ Object
18 19 20 |
# File 'lib/rosette/core/git/ref.rb', line 18 def inherited(subclass) descendants << subclass end |
.parse(ref_name) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/rosette/core/git/ref.rb', line 10 def parse(ref_name) chunks = ref_name.split(DELIMITER) if chunks.first == 'refs' create_from(chunks[1..-1]) end end |
Instance Method Details
#head? ⇒ Boolean
43 44 45 |
# File 'lib/rosette/core/git/ref.rb', line 43 def head? type == :head end |
#remote? ⇒ Boolean
39 40 41 |
# File 'lib/rosette/core/git/ref.rb', line 39 def remote? type == :remote end |
#tag? ⇒ Boolean
47 48 49 |
# File 'lib/rosette/core/git/ref.rb', line 47 def tag? type == :tag end |