Class: Wallaby::LookupContextWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/services/wallaby/lookup_context_wrapper.rb

Overview

Lookup context wrapper.

This is to take care of missing template in production. It will return ‘string` template if it doesn’t know how to handle the template.

See Also:

Defined Under Namespace

Classes: BlankTemplate

Instance Method Summary collapse

Constructor Details

#initialize(lookup_context) ⇒ LookupContextWrapper



14
15
16
# File 'lib/services/wallaby/lookup_context_wrapper.rb', line 14

def initialize(lookup_context)
  @lookup_context = lookup_context
end

Instance Method Details

#find_template(*args) ⇒ Object

See Also:

  • ActionView::LookupContext#find_template


20
21
22
23
24
25
# File 'lib/services/wallaby/lookup_context_wrapper.rb', line 20

def find_template(*args)
  @lookup_context.find_template(*args)
rescue ::ActionView::MissingTemplate
  raise if Rails.env.development?
  BlankTemplate.new
end