Module: Temple::Mixins::Template Private
- Includes:
- ClassOptions
- Included in:
- Templates::Rails, Templates::Tilt
- Defined in:
- lib/temple/mixins/template.rb
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
- #compile(code, options) ⇒ Object private
- #create(engine, options) ⇒ Object private
- #register_as(*names) ⇒ Object private
Methods included from ClassOptions
#default_options, #define_deprecated_options, #define_options, #disable_option_validator!, #options, #set_default_options, #set_options
Instance Method Details
#compile(code, options) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
8 9 10 11 12 |
# File 'lib/temple/mixins/template.rb', line 8 def compile(code, ) engine = .delete(:engine) raise 'No engine configured' unless engine engine.new().call(code) end |
#create(engine, options) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
18 19 20 21 22 23 24 25 26 |
# File 'lib/temple/mixins/template.rb', line 18 def create(engine, ) register_as = .delete(:register_as) template = Class.new(self) template.disable_option_validator! template.[:engine] = engine template..update() template.register_as(*register_as) if register_as template end |
#register_as(*names) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
14 15 16 |
# File 'lib/temple/mixins/template.rb', line 14 def register_as(*names) raise NotImplementedError end |