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

Instance Method Summary collapse

Methods inherited from Alchemy::Ingredient

#definition, #deprecated?, #essence, #has_hint?, #has_tinymce?, #has_validations?, normalize_type, #partial_name, #preview_ingredient?, related_object_alias, #settings, #settings_value, #to_partial_path, translated_label_for, #value

Methods included from Hints

#has_hint?, #hint

Instance Method Details

#level_optionsObject



21
22
23
# File 'app/models/alchemy/ingredients/headline.rb', line 21

def level_options
  levels.map { |level| ["H#{level}", level] }
end

#preview_text(maxlength = 30) ⇒ Object



17
18
19
# File 'app/models/alchemy/ingredients/headline.rb', line 17

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

#size_optionsObject



25
26
27
# File 'app/models/alchemy/ingredients/headline.rb', line 25

def size_options
  sizes.map { |size| [".h#{size}", size] }
end