Sha256: b99a84f4413faf0876cf75549fcdeeb884b6e89440b977fde798633a6cc7a909

Contents?: true

Size: 583 Bytes

Versions: 7

Compression:

Stored size: 583 Bytes

Contents

class Servel::Entry
  attr_reader :ftype, :type, :media_type, :listing_classes, :icon, :href, :name, :size, :mtime

  def initialize(ftype:, type:, media_type: nil, listing_classes:, icon:, href:, name:, size: nil, mtime: nil)
    @ftype = ftype
    @type = type
    @media_type = media_type
    @listing_classes = listing_classes
    @icon = icon
    @href = href
    @name = name
    @size = size
    @mtime = mtime
  end

  def directory?
    @ftype == :directory
  end

  def file?
    @ftype == :file
  end

  def media?
    !@media_type.nil?
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
servel-0.19.0 lib/servel/entry.rb
servel-0.18.0 lib/servel/entry.rb
servel-0.17.0 lib/servel/entry.rb
servel-0.16.0 lib/servel/entry.rb
servel-0.15.0 lib/servel/entry.rb
servel-0.13.0 lib/servel/entry.rb
servel-0.12.0 lib/servel/entry.rb