Class: Falsify::Customcollection
- Inherits:
-
Object
- Object
- Falsify::Customcollection
- Extended by:
- Enumerize
- Defined in:
- lib/falsify/models/product/collection/custom_collection.rb
Overview
Instance Attribute Summary collapse
-
#body_html ⇒ String
The description of the custom collection, complete with HTML markup.
-
#handle ⇒ String
A human-friendly unique string for the custom collection automatically generated from its title.
-
#id ⇒ String
readonly
The ID for the custom collection.
-
#image ⇒ Hash
Image associated with the custom collection.
-
#published ⇒ String
Whether the custom collection is published to the Online Store channel.
-
#published_at ⇒ String?
readonly
The time and date (ISO 8601 format) when the collection was made visible.
-
#published_scope ⇒ :web, :global
readonly
Whether the collection is published to the Point of Sale channel.
-
#sort_order ⇒ "alpha-asc", ...
The order in which products in the custom collection appear.
-
#template_suffix ⇒ String?
The suffix of the liquid template being used.
-
#title ⇒ String
The name of the custom collection.
-
#updated_at ⇒ String
readonly
The date and time (ISO 8601 format) when the custom collection was last modified.
Instance Attribute Details
#body_html ⇒ String
The description of the custom collection, complete with HTML markup. Many templates display this on their custom collection pages.
13 14 15 |
# File 'lib/falsify/models/product/collection/custom_collection.rb', line 13 def body_html @body_html end |
#handle ⇒ String
A human-friendly unique string for the custom collection automatically generated from its title. This is used in shop themes by the Liquid templating language to refer to the custom collection. (limit: 255 characters)
18 19 20 |
# File 'lib/falsify/models/product/collection/custom_collection.rb', line 18 def handle @handle end |
#id ⇒ String (readonly)
The ID for the custom collection.
31 32 33 |
# File 'lib/falsify/models/product/collection/custom_collection.rb', line 31 def id @id end |
#image ⇒ Hash
Image associated with the custom collection. Valid values are:
- attachment : An image attached to a custom collection returned as Base64-encoded binary data.
- src : The source URL that specifies the location of the image.
- alt : Alternative text that describes the collection image.
- created_at : The time and date (ISO 8601 format) when the image was added to the collection.
- width : The width of the image in pixels.
- height : The height of the image in pixels.
28 29 30 |
# File 'lib/falsify/models/product/collection/custom_collection.rb', line 28 def image @image end |
#published ⇒ String
Whether the custom collection is published to the Online Store channel.
34 35 36 |
# File 'lib/falsify/models/product/collection/custom_collection.rb', line 34 def published @published end |
#published_at ⇒ String? (readonly)
The time and date (ISO 8601 format) when the collection was made visible.
Returns null
for a hidden custom collection.
38 39 40 |
# File 'lib/falsify/models/product/collection/custom_collection.rb', line 38 def published_at @published_at end |
#published_scope ⇒ :web, :global (readonly)
Whether the collection is published to the Point of Sale channel. Valid values:
web
: The custom collection is published to the Online Store channel but not published to the Point of Sale channel.global
: The custom collection is published to both the Online Store channel and the Point of Sale channel.
45 |
# File 'lib/falsify/models/product/collection/custom_collection.rb', line 45 enumerize :published_scope, in: [:web, :global] |
#sort_order ⇒ "alpha-asc", ...
The order in which products in the custom collection appear. Valid values:
- alpha-asc : Alphabetically, in ascending order (A - Z).
- alpha-desc : Alphabetically, in descending order (Z - A).
- best-selling : By best-selling products.
- created : By date created, in ascending order (oldest - newest).
- created-desc : By date created, in descending order (newest - oldest).
- manual : Order created by the shop owner.
- price-asc : By price, in ascending order (lowest - highest).
- price-desc : By price, in descending order (highest - lowest). # @return [String]
58 59 60 |
# File 'lib/falsify/models/product/collection/custom_collection.rb', line 58 def sort_order @sort_order end |
#template_suffix ⇒ String?
The suffix of the liquid template being used.
For example, if the value is custom
, then the collection is using the collection.custom.liquid
template.
If the value is null
, then the collection is using the default collection.liquid
.
63 64 65 |
# File 'lib/falsify/models/product/collection/custom_collection.rb', line 63 def template_suffix @template_suffix end |
#title ⇒ String
The name of the custom collection. (limit: 255 characters)
67 68 69 |
# File 'lib/falsify/models/product/collection/custom_collection.rb', line 67 def title @title end |
#updated_at ⇒ String (readonly)
The date and time (ISO 8601 format) when the custom collection was last modified.
70 71 72 |
# File 'lib/falsify/models/product/collection/custom_collection.rb', line 70 def updated_at @updated_at end |