# Class Gitlab::Graph::Commit < Object

- lib/gitlab/graph/commit.rb

Methods

A
  - add_refs
M
  - method_missing
N
  - new
T
  - to_graph_hash

Included Modules

- ActionView::Helpers::TagHelper

Attributes

[RW] | refs |
[RW] | space |
[RW] | time |

Class Public methods
new(commit) Link

Source: show

    # File lib/gitlab/graph/commit.rb, line 10
    def initialize(commit)
      @_commit = commit
      @time = -1
      @space = 0
    end

Instance Public methods
add_refs(ref_cache, repo) Link

Source: show

    # File lib/gitlab/graph/commit.rb, line 36
    def add_refs(ref_cache, repo)
      if ref_cache.empty?
        repo.refs.each do |ref|
          ref_cache[ref.commit.id] ||= []
          ref_cache[ref.commit.id] << ref
        end
      end
      @refs = ref_cache[@_commit.id] if ref_cache.include?(@_commit.id)
      @refs ||= []
    end

method_missing(m, *args, &block) Link

Source: show

    # File lib/gitlab/graph/commit.rb, line 16
    def method_missing(m, *args, &block)
      @_commit.send(m, *args, &block)
    end

to_graph_hash() Link

Source: show

    # File lib/gitlab/graph/commit.rb, line 20
    def to_graph_hash
      h = {}
      h[:parents] = self.parents.collect do |p|
        [p.id,0,0]
      end
      h[:author]  = author.name
      h[:time]    = time
      h[:space]   = space
      h[:refs]    = refs.collect{|r|r.name}.join(" ") unless refs.nil?
      h[:id]      = sha
      h[:date]    = date
      h[:message] = message
      h[:login]   = author.email
      h
    end