abstract class
Bakelite::Item
- Bakelite::Item
- Reference
- Object
Overview
Abstract representation of an embedded or stored virtual file.
Direct Known Subclasses
Defined in:
bakelite/item.crConstructors
Instance Method Summary
- #compressed_size : Int64
-
#content : String
Alias for to_s for instant content inspection.
- #crc32 : UInt32
-
#crc32_hex : String
Hexadecimal formatted CRC32 checksum (e.g.
-
#etag : String
HTTP-compliant ETag string based on CRC32 checksum and file size.
-
#extract(target_path : Path | String, overwrite : Bool = true) : Bool
Extracts this virtual file to a target path on disk.
- #mime_type : String
-
#open : IO
Opens a readable stream for this asset.
-
#open(&block : IO -> T) : T forall T
Yields an open stream to the block and automatically closes it upon completion.
- #path : String
- #size : Int64
- #storage_mode : StorageMode
-
#to_s(io : IO) : Nil
Streams the content into the given output IO.
-
#to_s : String
Returns the content as a UTF-8 String.
-
#to_slice : Bytes
Returns the full contents as a byte slice.
- #volume_name : String
Constructor Detail
def self.new(path : String, volume_name : Symbol | String, size : Int64, compressed_size : Int64, mime_type : String, crc32 : UInt32, storage_mode : StorageMode)
#
Instance Method Detail
def extract(target_path : Path | String, overwrite : Bool = true) : Bool
#
Extracts this virtual file to a target path on disk.
def open(&block : IO -> T) : T forall T
#
Yields an open stream to the block and automatically closes it upon completion.