Class: PufferPages::Backends::Snippet
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- PufferPages::Backends::Snippet
- Includes:
- ActiveUUID::UUID, Mixins::Importable, Mixins::Renderable, Mixins::Translatable
- Defined in:
- lib/puffer_pages/backends/models/snippet.rb
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
- #additional_render_options ⇒ Object
- #i18n_defaults ⇒ Object
- #i18n_scope ⇒ Object
- #render(*args) ⇒ Object
Methods included from Mixins::Renderable
Class Method Details
.find_snippet(name) ⇒ Object
14 15 16 |
# File 'lib/puffer_pages/backends/models/snippet.rb', line 14 def self.find_snippet(name) where(:name => name).first end |
Instance Method Details
#additional_render_options ⇒ Object
23 24 25 |
# File 'lib/puffer_pages/backends/models/snippet.rb', line 23 def { environment: { processed: self } } end |
#i18n_defaults ⇒ Object
31 32 33 |
# File 'lib/puffer_pages/backends/models/snippet.rb', line 31 def i18n_defaults [] end |
#i18n_scope ⇒ Object
27 28 29 |
# File 'lib/puffer_pages/backends/models/snippet.rb', line 27 def i18n_scope [:snippets, name.to_sym] end |
#render(*args) ⇒ Object
18 19 20 21 |
# File 'lib/puffer_pages/backends/models/snippet.rb', line 18 def render *args _, context = *args render_template body, context, end |