Module: Dry::View::Tilt Private

Extended by:
Core::Cache
Defined in:
lib/dry/view/tilt.rb,
lib/dry/view/tilt/erb.rb,
lib/dry/view/tilt/haml.rb,
lib/dry/view/tilt/erbse.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.

Defined Under Namespace

Modules: ERB, Haml Classes: ErbseTemplate

Class Method Summary collapse

Class Method Details

.[](path, mapping, **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.



13
14
15
16
17
18
# File 'lib/dry/view/tilt.rb', line 13

def [](path, mapping, **options)
  ext = File.extname(path).sub(/^./, "").to_sym
  activate_adapter ext

  with_mapping(mapping).new(path, **options)
end

.default_mappingObject

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.



20
21
22
# File 'lib/dry/view/tilt.rb', line 20

def default_mapping
  ::Tilt.default_mapping
end

.deregister_adapter(ext) ⇒ 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.



28
29
30
# File 'lib/dry/view/tilt.rb', line 28

def deregister_adapter(ext)
  adapters.delete(ext)
end

.register_adapter(ext, adapter) ⇒ 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.



24
25
26
# File 'lib/dry/view/tilt.rb', line 24

def register_adapter(ext, adapter)
  adapters[ext] = adapter
end