gitlab-org--gitlab-foss/app/models/network/commit.rb

33 lines
613 B
Ruby
Raw Normal View History

# frozen_string_literal: true
module Network
class Commit
include ActionView::Helpers::TagHelper
attr_accessor :time, :spaces, :parent_spaces
def initialize(raw_commit)
@commit = raw_commit
@time = -1
@spaces = []
@parent_spaces = []
end
2018-07-04 10:02:01 -04:00
def method_missing(msg, *args, &block)
@commit.__send__(msg, *args, &block) # rubocop:disable GitlabSecurity/PublicSend
end
def space
2018-09-18 03:36:24 -04:00
if @spaces.present?
@spaces.first
else
0
end
end
def parents(map)
map.values_at(*@commit.parent_ids).compact
end
end
end