class Tilt::FinalizedMapping
Private internal class for finalized mappings, which are frozen and cannot be modified.
Public Class Methods
new(template_map)
click to toggle source
Set the template map to use. The template map should already be frozen, but this is an internal class, so it does not explicitly check for that.
# File lib/tilt/mapping.rb 374 def initialize(template_map) 375 @template_map = template_map 376 freeze 377 end
Public Instance Methods
clone(freeze: false)
click to toggle source
Returns receiver, since instances are always frozen.
# File lib/tilt/mapping.rb 385 def clone(freeze: false) 386 self 387 end
dup()
click to toggle source
Returns receiver, since instances are always frozen.
# File lib/tilt/mapping.rb 380 def dup 381 self 382 end
extensions_for(template_class)
click to toggle source
Returns an aarry of all extensions the template class will be used for.
# File lib/tilt/mapping.rb 396 def extensions_for(template_class) 397 res = [] 398 @template_map.each do |ext, klass| 399 res << ext if template_class == klass 400 end 401 res.uniq! 402 res 403 end
registered?(ext)
click to toggle source
Return whether the given file extension has been registered.
# File lib/tilt/mapping.rb 390 def registered?(ext) 391 @template_map.has_key?(ext.downcase) 392 end
Private Instance Methods
lookup(ext)
click to toggle source
# File lib/tilt/mapping.rb 407 def lookup(ext) 408 @template_map[ext] 409 end