Class: Alchemy::Ingredients::Headline

Inherits:
Alchemy::Ingredient show all
Includes:
DomIds
Defined in:
app/models/alchemy/ingredients/headline.rb

Overview

A text headline

Constant Summary

Constants included from DomIds

DomIds::RESERVED_ANCHOR_SETTING_VALUES

Constants included from SearchableResource

SearchableResource::SEARCHABLE_COLUMN_TYPES

Instance Method Summary collapse

Methods inherited from Alchemy::Ingredient

allow_settings, allowed_settings, #as_editor_component, #as_view_component, #definition, #deprecated?, #has_tinymce?, #has_validations?, #linked?, normalize_type, #partial_name, #preview_ingredient?, related_object_alias, #settings, translated_label_for, #translated_role, #value

Methods included from ConfigMissing

#const_missing

Methods included from SearchableResource

#ransackable_associations, #ransackable_attributes, #ransackable_scopes, #ransortable_attributes

Instance Method Details

#levelsObject



27
28
29
# File 'app/models/alchemy/ingredients/headline.rb', line 27

def levels
  settings.fetch(:levels, 1..6)
end

#preview_text(maxlength = 30) ⇒ Object



23
24
25
# File 'app/models/alchemy/ingredients/headline.rb', line 23

def preview_text(maxlength = 30)
  "H#{level}: #{value}"[0..maxlength - 1]
end

#sizesObject



31
32
33
# File 'app/models/alchemy/ingredients/headline.rb', line 31

def sizes
  settings.fetch(:sizes, [])
end