Sha256: aafa6e92a1db64032c26c03df09b032d4c380d63a6411fdd325b7fb7c94a6841
Contents?: true
Size: 1.01 KB
Versions: 1
Compression:
Stored size: 1.01 KB
Contents
class Servel::Path attr_reader :type, :media_type, :listing_classes, :icon, :href, :name, :size, :mtime def initialize(type:, media_type:, listing_classes:, icon:, href:, name:, size: nil, mtime: nil) @type = type @media_type = media_type @listing_classes = listing_classes @icon = icon @href = href @name = name @size = size @mtime = mtime end def listing_attrs { class: @listing_classes, data: { type: @media_type } } end def media? @media_type != "unknown" end def self.top(href) Servel::Path.new( type: "Dir", media_type: "unknown", listing_classes: "top directory", icon: "🔝", href: href, name: "Top Directory" ) end def self.parent(href) Servel::Path.new( type: "Dir", media_type: "unknown", listing_classes: "parent directory", icon: "⬆️", href: href, name: "Parent Directory" ) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
servel-0.6.0 | lib/servel/path.rb |