2018-07-19 14:43:13 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-05-26 14:51:24 -04:00
|
|
|
class TreeEntity < Grape::Entity
|
|
|
|
include RequestAwareEntity
|
|
|
|
|
|
|
|
expose :id, :path, :name, :mode
|
|
|
|
|
|
|
|
expose :icon do |tree|
|
|
|
|
IconsHelper.file_type_icon_class('folder', tree.mode, tree.name)
|
|
|
|
end
|
|
|
|
|
|
|
|
expose :url do |tree|
|
2017-07-20 17:42:36 -04:00
|
|
|
project_tree_path(request.project, File.join(request.ref, tree.path))
|
2017-05-26 14:51:24 -04:00
|
|
|
end
|
|
|
|
end
|