class

Bakelite::Item

Inherits Reference < Object

Abstract representation of an embedded or stored virtual file.

Constructors

new(path : String, volume_name : Symbol | String, size : Int64, compressed_size : Int64, mime_type : String, crc32 : UInt32, storage_mode : StorageMode)
Source

Instance methods

compressed_size
Source
content

Alias for to_s for instant content inspection.

Source
crc32
Source
crc32_hex

Hexadecimal formatted CRC32 checksum (e.g. "a1b2c3d4").

Source
etag

HTTP-compliant ETag string based on CRC32 checksum and file size.

Source
extract(target_path : Path | String, overwrite : Bool = true) : Bool

Extracts this virtual file to a target path on disk.

Source
mime_type
Source
open

Opens a readable stream for this asset.

Source
open

Yields an open stream to the block and automatically closes it upon completion.

Source
path
Source
size
Source
storage_mode
Source
to_s(io : IO) : Nil

Streams the content into the given output IO.

Source
to_s

Returns the content as a UTF-8 String.

Source
to_slice

Returns the full contents as a byte slice.

Source
volume_name
Source