Class: Parse::Core::EmbedManaged::EmbedDirective
- Inherits:
-
Struct
- Object
- Struct
- Parse::Core::EmbedManaged::EmbedDirective
- Defined in:
- lib/parse/model/core/embed_managed.rb
Overview
Frozen value-object capturing one embed or embed_image
declaration. Stored on the owning class under
embed_directives[into] and passed to
recompute_embedding! from the per-class
before_save callback.
modality is nil (treated as :text) for embed-declared
directives and :image for embed_image. The image path
routes through Parse::Embeddings.validate_image_url! and
Provider#embed_image rather than Provider#embed_text;
digest tracking is over the file URL String rather than the
concatenated source text.
allow_insecure is forwarded to validate_image_url! for
image directives only; ignored for text.
source_mode (image directives only) is :url (forward the
validated URL to the provider — v5.1 behavior, requires the
trust_provider_url_fetch sentinel) or :bytes (the SDK
downloads via File.safe_open_url, magic-byte-verifies,
EXIF-strips, and forwards base64 — v5.5). exif_strip
(default true) applies to :bytes mode only.
meta_field names the :object sibling that records
provider/model/dimensions provenance on every recompute — the
input ClassMethods#reembed! uses to find stale rows after a
model migration.
Instance Attribute Summary collapse
-
#allow_insecure ⇒ Object
Returns the value of attribute allow_insecure.
-
#digest_field ⇒ Object
Returns the value of attribute digest_field.
-
#exif_strip ⇒ Object
Returns the value of attribute exif_strip.
-
#input_type ⇒ Object
Returns the value of attribute input_type.
-
#into ⇒ Object
Returns the value of attribute into.
-
#meta_field ⇒ Object
Returns the value of attribute meta_field.
-
#modality ⇒ Object
Returns the value of attribute modality.
-
#provider_name ⇒ Object
Returns the value of attribute provider_name.
-
#source_mode ⇒ Object
Returns the value of attribute source_mode.
-
#sources ⇒ Object
Returns the value of attribute sources.
Instance Method Summary collapse
Instance Attribute Details
#allow_insecure ⇒ Object
Returns the value of attribute allow_insecure
124 125 126 |
# File 'lib/parse/model/core/embed_managed.rb', line 124 def allow_insecure @allow_insecure end |
#digest_field ⇒ Object
Returns the value of attribute digest_field
124 125 126 |
# File 'lib/parse/model/core/embed_managed.rb', line 124 def digest_field @digest_field end |
#exif_strip ⇒ Object
Returns the value of attribute exif_strip
124 125 126 |
# File 'lib/parse/model/core/embed_managed.rb', line 124 def exif_strip @exif_strip end |
#input_type ⇒ Object
Returns the value of attribute input_type
124 125 126 |
# File 'lib/parse/model/core/embed_managed.rb', line 124 def input_type @input_type end |
#into ⇒ Object
Returns the value of attribute into
124 125 126 |
# File 'lib/parse/model/core/embed_managed.rb', line 124 def into @into end |
#meta_field ⇒ Object
Returns the value of attribute meta_field
124 125 126 |
# File 'lib/parse/model/core/embed_managed.rb', line 124 def @meta_field end |
#modality ⇒ Object
Returns the value of attribute modality
124 125 126 |
# File 'lib/parse/model/core/embed_managed.rb', line 124 def modality @modality end |
#provider_name ⇒ Object
Returns the value of attribute provider_name
124 125 126 |
# File 'lib/parse/model/core/embed_managed.rb', line 124 def provider_name @provider_name end |
#source_mode ⇒ Object
Returns the value of attribute source_mode
124 125 126 |
# File 'lib/parse/model/core/embed_managed.rb', line 124 def source_mode @source_mode end |
#sources ⇒ Object
Returns the value of attribute sources
124 125 126 |
# File 'lib/parse/model/core/embed_managed.rb', line 124 def sources @sources end |
Instance Method Details
#bytes_mode? ⇒ Boolean
138 139 140 |
# File 'lib/parse/model/core/embed_managed.rb', line 138 def bytes_mode? source_mode == :bytes end |
#freeze ⇒ Object
129 130 131 132 |
# File 'lib/parse/model/core/embed_managed.rb', line 129 def freeze sources.freeze super end |
#image? ⇒ Boolean
134 135 136 |
# File 'lib/parse/model/core/embed_managed.rb', line 134 def image? modality == :image end |