# frozen_string_literal: true class Project class File < Entry def initialize(...) super @type = @path.extname @last_modified_at = nil end def parent?(parent) return false if parent.nil? parent.key.slice(0, key.size - 1) == key[..-2] # Without filename end def child?(_child) false end def self_or_child?(_child) false end def content if @last_modified_at == modified_at @content else @last_modified_at = modified_at @content = ::File.read(@path) end end def mime_type Marcel::MimeType.for(@path) end private def modified_at @path.mtime end end end