Module: Noumenon::Template::CoreTags::Filters
- Defined in:
- lib/noumenon/template/core_tags.rb
Overview
The core set of filters provided by Noumenon for use in templates.
Instance Method Summary collapse
-
#assign_to(input, variable) ⇒ Object
Assigns the data piped in to the named variable.
-
#item_at_path(input) ⇒ Object
Loads the content item at the path provided and passes it on.
-
#textilize(input) ⇒ Object
Formats the provided text using Textile.
Instance Method Details
#assign_to(input, variable) ⇒ Object
Assigns the data piped in to the named variable.
20 21 22 23 |
# File 'lib/noumenon/template/core_tags.rb', line 20 def assign_to(input, variable) @context.scopes.last[variable] = input '' end |
#item_at_path(input) ⇒ Object
Loads the content item at the path provided and passes it on.
If nothing was found then nothing will be returned, allowing the presence of some content to be checked before trying to use it.
38 39 40 41 |
# File 'lib/noumenon/template/core_tags.rb', line 38 def item_at_path(input) item = Noumenon.content_repository.get(input) item ? item.stringify_keys : nil end |
#textilize(input) ⇒ Object
Formats the provided text using Textile.
50 51 52 |
# File 'lib/noumenon/template/core_tags.rb', line 50 def textilize(input) RedCloth.new(input).to_html end |