Class: Anydoc::Asset

Inherits:
Data
  • Object
show all
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

Instance Attribute Details

#dataString (readonly)

Returns the payload, exactly as stored in the source, as a binary (ASCII-8BIT) string.

Returns:

  • (String)

    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

#idInteger (readonly)

Returns index into Document#assets, as referenced by an image source.

Returns:

  • (Integer)

    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_typeString (readonly)

Returns MIME type, e.g. image/png.

Returns:

  • (String)

    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_partString (readonly)

Returns package part or stream the asset came from, for provenance.

Returns:

  • (String)

    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