class BrowseEverything::FileEntry

Attributes

id[R]
location[R]
mtime[R]
name[R]
size[R]
type[R]

Public Class Methods

new(id, location, name, size, mtime, container, type = nil) click to toggle source
# File lib/browse_everything/file_entry.rb, line 7
def initialize(id, location, name, size, mtime, container, type = nil)
  @id        = id
  @location  = location
  @name      = name
  @size      = size
  @mtime     = mtime
  @container = container
  @type      = type || (@container ? 'application/x-directory' : Rack::Mime.mime_type(File.extname(name)))
end

Public Instance Methods

container?() click to toggle source
# File lib/browse_everything/file_entry.rb, line 21
def container?
  @container
end
relative_parent_path?() click to toggle source
# File lib/browse_everything/file_entry.rb, line 17
def relative_parent_path?
  name.match?(/^\.\.?$/)
end