Class: Anydoc::Asset
- Inherits:
-
Data
- Object
- Data
- Anydoc::Asset
- Defined in:
- lib/anydoc/document.rb,
sig/anydoc.rbs
Overview
An embedded binary asset (image, object payload). Bytes are always retained, so a document stays self-contained.
Instance Attribute Summary collapse
-
#data ⇒ String
readonly
The payload, exactly as stored in the source, as a binary (ASCII-8BIT) string.
-
#id ⇒ Integer
readonly
Index into Document#assets, as referenced by an image source.
-
#media_type ⇒ String
readonly
MIME type, e.g.
-
#origin_part ⇒ String
readonly
Package part or stream the asset came from, for provenance.
Instance Attribute Details
#data ⇒ String (readonly)
Returns the payload, exactly as stored in the source, as a binary (ASCII-8BIT) string.
222 223 |
# File 'lib/anydoc/document.rb', line 222 class Asset < Data.define(:id, :media_type, :origin_part, :data) end |
#id ⇒ Integer (readonly)
Returns index into Document#assets, as referenced by an image source.
222 223 |
# File 'lib/anydoc/document.rb', line 222 class Asset < Data.define(:id, :media_type, :origin_part, :data) end |
#media_type ⇒ String (readonly)
Returns MIME type, e.g. image/png.
222 223 |
# File 'lib/anydoc/document.rb', line 222 class Asset < Data.define(:id, :media_type, :origin_part, :data) end |
#origin_part ⇒ String (readonly)
Returns package part or stream the asset came from, for provenance.
222 223 |
# File 'lib/anydoc/document.rb', line 222 class Asset < Data.define(:id, :media_type, :origin_part, :data) end |