Sha256: 19049bdcbe7d21e0d8e92692f961a321f3e6df267282ba968b43e5f54d3e347b

Contents?: true

Size: 582 Bytes

Versions: 22

Compression:

Stored size: 582 Bytes

Contents

module BrowseEverything
  class FileEntry
    attr_reader :id, :location, :name, :size, :mtime, :type

    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

    def relative_parent_path?
      name =~ /^\.\.?$/ ? true : false
    end
    
    def container?
      @container
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
browse-everything-0.10.5 lib/browse_everything/file_entry.rb
browse-everything-0.10.4 lib/browse_everything/file_entry.rb
browse-everything-0.10.3 lib/browse_everything/file_entry.rb
browse-everything-0.10.2 lib/browse_everything/file_entry.rb
browse-everything-0.10.1 lib/browse_everything/file_entry.rb
browse-everything-0.10.0 lib/browse_everything/file_entry.rb
browse-everything-0.9.1 lib/browse_everything/file_entry.rb
browse-everything-0.9.0 lib/browse_everything/file_entry.rb
browse-everything-0.8.4 lib/browse_everything/file_entry.rb
browse-everything-0.8.3 lib/browse_everything/file_entry.rb
browse-everything-0.8.2 lib/browse_everything/file_entry.rb
browse-everything-0.8.1 lib/browse_everything/file_entry.rb
browse-everything-0.8.0 lib/browse_everything/file_entry.rb
browse-everything-0.7.1 lib/browse_everything/file_entry.rb
browse-everything-0.7.0 lib/browse_everything/file_entry.rb
browse-everything-0.6.3 lib/browse_everything/file_entry.rb
browse-everything-0.6.2 lib/browse_everything/file_entry.rb
browse-everything-0.6.1 lib/browse_everything/file_entry.rb
browse-everything-0.6.0 lib/browse_everything/file_entry.rb
browse-everything-0.5.2 lib/browse_everything/file_entry.rb