Class: Coradoc::CoreModel::Image
- Defined in:
- lib/coradoc/core_model/image.rb
Overview
Represents an image in a document
Images can be block-level (standalone) or inline. They support various attributes like alt text, dimensions, and linking.
Instance Attribute Summary collapse
-
#alt ⇒ String?
Alternative text for accessibility.
-
#caption ⇒ String?
Caption text for the image.
-
#float ⇒ String?
Float position (‘left’, ‘right’).
-
#height ⇒ String?
Image height (e.g., ‘300px’, ‘auto’).
-
#inline ⇒ Boolean
Whether this is an inline image.
-
#link ⇒ String?
URL to link to when image is clicked.
-
#src ⇒ String?
Source URL or path to the image.
-
#width ⇒ String?
Image width (e.g., ‘100%’, ‘500px’).
Attributes inherited from Base
#element_attributes, #id, #metadata_entries, #title
Method Summary
Methods inherited from Base
#accept, #attr, #metadata, #semantically_equivalent?, #set_attr, #set_metadata
Instance Attribute Details
#alt ⇒ String?
Returns alternative text for accessibility.
31 |
# File 'lib/coradoc/core_model/image.rb', line 31 attribute :alt, :string |
#caption ⇒ String?
Populated by HTML converter only
Returns caption text for the image.
36 |
# File 'lib/coradoc/core_model/image.rb', line 36 attribute :caption, :string |
#float ⇒ String?
Not yet wired by any transformer; reserved for future use
Returns float position (‘left’, ‘right’).
58 |
# File 'lib/coradoc/core_model/image.rb', line 58 attribute :float, :string |
#height ⇒ String?
Returns image height (e.g., ‘300px’, ‘auto’).
44 |
# File 'lib/coradoc/core_model/image.rb', line 44 attribute :height, :string |
#inline ⇒ Boolean
Returns whether this is an inline image.
53 |
# File 'lib/coradoc/core_model/image.rb', line 53 attribute :inline, :boolean, default: -> { false } |
#link ⇒ String?
Not yet wired by any transformer; reserved for future use
Returns URL to link to when image is clicked.
49 |
# File 'lib/coradoc/core_model/image.rb', line 49 attribute :link, :string |
#src ⇒ String?
Returns source URL or path to the image.
27 |
# File 'lib/coradoc/core_model/image.rb', line 27 attribute :src, :string |
#width ⇒ String?
Returns image width (e.g., ‘100%’, ‘500px’).
40 |
# File 'lib/coradoc/core_model/image.rb', line 40 attribute :width, :string |