Class: Refs::SymRef

Inherits:
Struct
  • Object
show all
Defined in:
lib/refs.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



11
12
13
# File 'lib/refs.rb', line 11

def path
  @path
end

#refsObject

Returns the value of attribute refs

Returns:

  • (Object)

    the current value of refs



11
12
13
# File 'lib/refs.rb', line 11

def refs
  @refs
end

Instance Method Details

#branch?Boolean

Returns:

  • (Boolean)


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

def branch?
  path.start_with?("refs/heads/")
end

#head?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/refs.rb', line 16

def head?
  path == HEAD
end

#read_oidObject



12
13
14
# File 'lib/refs.rb', line 12

def read_oid
  refs.read_ref(path)
end

#remote?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/refs.rb', line 24

def remote?
  path.start_with?("refs/remotes/")
end

#short_nameObject



28
29
30
# File 'lib/refs.rb', line 28

def short_name
  refs.short_name(path)
end