summaryrefslogtreecommitdiff
path: root/lib/api/entities/tree_object.rb
blob: e4e840ebe43b65973548eef7bbcaed27572dd4a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

module API
  module Entities
    class TreeObject < Grape::Entity
      expose :id, :name, :type, :path

      expose :mode do |obj, options|
        filemode = obj.mode
        filemode = "0" + filemode if filemode.length < 6
        filemode
      end
    end
  end
end