Class: Studio::EmailCatalog::Entry
- Inherits:
-
Struct
- Object
- Struct
- Studio::EmailCatalog::Entry
- Defined in:
- app/services/studio/email_catalog.rb
Overview
A registered email. default_asset — logical asset path inside the gem (resolved through the host's pipeline); nil means no inherited artwork. type — :transactional or :marketing. preview — callable returning a Mail, or nil.
Instance Attribute Summary collapse
-
#aspect_ratio ⇒ Object
Returns the value of attribute aspect_ratio.
-
#default_asset ⇒ Object
Returns the value of attribute default_asset.
-
#default_origin ⇒ Object
Returns the value of attribute default_origin.
-
#description ⇒ Object
Returns the value of attribute description.
-
#key ⇒ Object
Returns the value of attribute key.
-
#label ⇒ Object
Returns the value of attribute label.
-
#preview ⇒ Object
Returns the value of attribute preview.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#engine_artwork? ⇒ Boolean
WHOSE artwork default_asset names.
-
#marketing? ⇒ Boolean
nil-safe: an Entry built directly (the STANDARD seed) may carry no type.
- #previewable? ⇒ Boolean
-
#ratio ⇒ Object
The shape of THIS email's banner — the box the page draws and the ratio the upload cropper enforces.
- #to_s ⇒ Object
Instance Attribute Details
#aspect_ratio ⇒ Object
Returns the value of attribute aspect_ratio
76 77 78 |
# File 'app/services/studio/email_catalog.rb', line 76 def aspect_ratio @aspect_ratio end |
#default_asset ⇒ Object
Returns the value of attribute default_asset
76 77 78 |
# File 'app/services/studio/email_catalog.rb', line 76 def default_asset @default_asset end |
#default_origin ⇒ Object
Returns the value of attribute default_origin
76 77 78 |
# File 'app/services/studio/email_catalog.rb', line 76 def default_origin @default_origin end |
#description ⇒ Object
Returns the value of attribute description
76 77 78 |
# File 'app/services/studio/email_catalog.rb', line 76 def description @description end |
#key ⇒ Object
Returns the value of attribute key
76 77 78 |
# File 'app/services/studio/email_catalog.rb', line 76 def key @key end |
#label ⇒ Object
Returns the value of attribute label
76 77 78 |
# File 'app/services/studio/email_catalog.rb', line 76 def label @label end |
#preview ⇒ Object
Returns the value of attribute preview
76 77 78 |
# File 'app/services/studio/email_catalog.rb', line 76 def preview @preview end |
#type ⇒ Object
Returns the value of attribute type
76 77 78 |
# File 'app/services/studio/email_catalog.rb', line 76 def type @type end |
Instance Method Details
#engine_artwork? ⇒ Boolean
WHOSE artwork default_asset names. Recorded at registration rather than inferred later: by the time the page asks, a resolved asset path looks identical whether the file came from the gem or from the host, and guessing from the path is exactly the wrong-answer machine this exists to remove. The engine seeds its own two as :engine; anything a host passes default_asset for is that host's own.
89 |
# File 'app/services/studio/email_catalog.rb', line 89 def engine_artwork? = default_origin.to_s != "app" |
#marketing? ⇒ Boolean
nil-safe: an Entry built directly (the STANDARD seed) may carry no type.
81 |
# File 'app/services/studio/email_catalog.rb', line 81 def marketing? = type.to_s == "marketing" |
#previewable? ⇒ Boolean
79 80 |
# File 'app/services/studio/email_catalog.rb', line 79 def previewable? = preview.respond_to?(:call) # nil-safe: an Entry built directly (the STANDARD seed) may carry no type. |
#ratio ⇒ Object
The shape of THIS email's banner — the box the page draws and the ratio the upload cropper enforces. Per-entry because the engine's own artwork is 3:1 while turf-monster's eight banners are 2:1; one global constant would letterbox one app's art and crop the other's on every upload.
95 |
# File 'app/services/studio/email_catalog.rb', line 95 def ratio = (aspect_ratio || ASPECT_RATIO).to_f |
#to_s ⇒ Object
78 |
# File 'app/services/studio/email_catalog.rb', line 78 def to_s = key |