debian-mirror-gitlab/lib/gitlab/graphql/representation/tree_entry.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

34 lines
677 B
Ruby
Raw Normal View History

2019-09-04 21:01:54 +05:30
# frozen_string_literal: true
module Gitlab
module Graphql
module Representation
class TreeEntry < SimpleDelegator
2019-12-04 20:38:33 +05:30
include GlobalID::Identification
2019-09-04 21:01:54 +05:30
class << self
def decorate(entries, repository)
return if entries.nil?
entries.map do |entry|
if entry.is_a?(TreeEntry)
entry
else
self.new(entry, repository)
end
end
end
end
attr_accessor :repository
def initialize(raw_entry, repository)
@repository = repository
super(raw_entry)
end
end
end
end
end