Class: Journeybook::PageTemplateRegistry::Template
- Inherits:
-
Data
- Object
- Data
- Journeybook::PageTemplateRegistry::Template
- Defined in:
- lib/journeybook/page_template_registry.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
Instance Method Summary collapse
- #available_for_site?(site) ⇒ Boolean
- #description ⇒ Object
- #markdown ⇒ Object
- #name ⇒ Object
- #page_type ⇒ Object
- #path_hint ⇒ Object
- #path_prefix ⇒ Object
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key
3 4 5 |
# File 'lib/journeybook/page_template_registry.rb', line 3 def key @key end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata
3 4 5 |
# File 'lib/journeybook/page_template_registry.rb', line 3 def @metadata end |
Instance Method Details
#available_for_site?(site) ⇒ Boolean
28 29 30 31 |
# File 'lib/journeybook/page_template_registry.rb', line 28 def available_for_site?(site) sites = Array([:sites]).map(&:to_s) sites.empty? || site && site.key.in?(sites) end |
#description ⇒ Object
8 9 10 |
# File 'lib/journeybook/page_template_registry.rb', line 8 def description .fetch(:description, "") end |
#markdown ⇒ Object
16 17 18 |
# File 'lib/journeybook/page_template_registry.rb', line 16 def markdown .fetch(:markdown, "").to_s end |
#name ⇒ Object
4 5 6 |
# File 'lib/journeybook/page_template_registry.rb', line 4 def name .fetch(:name, key.to_s.humanize) end |
#page_type ⇒ Object
12 13 14 |
# File 'lib/journeybook/page_template_registry.rb', line 12 def page_type .fetch(:page_type, "page").to_s end |
#path_hint ⇒ Object
24 25 26 |
# File 'lib/journeybook/page_template_registry.rb', line 24 def path_hint [:path_hint].to_s.presence end |
#path_prefix ⇒ Object
20 21 22 |
# File 'lib/journeybook/page_template_registry.rb', line 20 def path_prefix [:path_prefix].to_s.presence end |