Class: Gitlab::Graphql::Representation::TreeEntry
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Gitlab::Graphql::Representation::TreeEntry
- Includes:
- GlobalID::Identification
- Defined in:
- lib/gitlab/graphql/representation/tree_entry.rb
Instance Attribute Summary collapse
-
#repository ⇒ Object
Returns the value of attribute repository.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(raw_entry, repository) ⇒ TreeEntry
constructor
A new instance of TreeEntry.
Constructor Details
#initialize(raw_entry, repository) ⇒ TreeEntry
Returns a new instance of TreeEntry.
25 26 27 28 29 |
# File 'lib/gitlab/graphql/representation/tree_entry.rb', line 25 def initialize(raw_entry, repository) @repository = repository super(raw_entry) end |
Instance Attribute Details
#repository ⇒ Object
Returns the value of attribute repository.
23 24 25 |
# File 'lib/gitlab/graphql/representation/tree_entry.rb', line 23 def repository @repository end |
Class Method Details
.decorate(entries, repository) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/gitlab/graphql/representation/tree_entry.rb', line 10 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 |