ec2b4bb65d
- `edge_nodes` needs to get called on the object - added `include GlobalID::Identification` in a couple places - renamed `object` to `item` in spec due to conflict
33 lines
677 B
Ruby
33 lines
677 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Gitlab
|
|
module Graphql
|
|
module Representation
|
|
class TreeEntry < SimpleDelegator
|
|
include GlobalID::Identification
|
|
|
|
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
|