Class: Redcar::Scm::ScmCommitsMirror::CommitsNode

Inherits:
Object
  • Object
show all
Includes:
Tree::Mirror::NodeMirror
Defined in:
plugins/scm/lib/scm/scm_commits_mirror/commits_node.rb

Constant Summary

Constant Summary

Constants included from Observable

Observable::ASPECTS

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Methods included from Tree::Mirror::NodeMirror

#tooltip_text

Methods included from Observable

#add_listener, #notify_listeners, #remove_listener

Constructor Details

- (CommitsNode) initialize(repo, branch = nil, text = nil)

A new instance of CommitsNode



10
11
12
13
14
# File 'plugins/scm/lib/scm/scm_commits_mirror/commits_node.rb', line 10

def initialize(repo, branch=nil, text=nil)
  @repo = repo
  @branch = branch
  @text = text || branch || @repo.translations[:unpushed_commits]
end

Instance Attribute Details

- (Object) branch (readonly)

Returns the value of attribute branch



8
9
10
# File 'plugins/scm/lib/scm/scm_commits_mirror/commits_node.rb', line 8

def branch
  @branch
end

- (Object) repo (readonly)

Returns the value of attribute repo



8
9
10
# File 'plugins/scm/lib/scm/scm_commits_mirror/commits_node.rb', line 8

def repo
  @repo
end

Instance Method Details

- (Object) children



28
29
30
31
32
33
34
# File 'plugins/scm/lib/scm/scm_commits_mirror/commits_node.rb', line 28

def children
  if branch
    @repo.unpushed_commits(branch)
  else
    @repo.unpushed_commits
  end
end

- (Object) icon



20
21
22
# File 'plugins/scm/lib/scm/scm_commits_mirror/commits_node.rb', line 20

def icon
  :folder--arrow"
end

- (Boolean) leaf?

Returns:

  • (Boolean)


24
25
26
# File 'plugins/scm/lib/scm/scm_commits_mirror/commits_node.rb', line 24

def leaf?
  false
end

- (Object) text



16
17
18
# File 'plugins/scm/lib/scm/scm_commits_mirror/commits_node.rb', line 16

def text
  @text
end