Class: Lookbook::ActionViewAnnotationsHandler
- Defined in:
- lib/lookbook/services/templates/action_view_annotations_handler.rb
Instance Attribute Summary collapse
- #disable_annotations ⇒ Object readonly
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(disable_annotations: true) ⇒ ActionViewAnnotationsHandler
constructor
A new instance of ActionViewAnnotationsHandler.
Methods inherited from Service
Constructor Details
#initialize(disable_annotations: true) ⇒ ActionViewAnnotationsHandler
Returns a new instance of ActionViewAnnotationsHandler.
5 6 7 |
# File 'lib/lookbook/services/templates/action_view_annotations_handler.rb', line 5 def initialize(disable_annotations: true) @disable_annotations = disable_annotations end |
Instance Attribute Details
#disable_annotations ⇒ Object (readonly)
3 4 5 |
# File 'lib/lookbook/services/templates/action_view_annotations_handler.rb', line 3 def disable_annotations @disable_annotations end |
Instance Method Details
#call ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/lookbook/services/templates/action_view_annotations_handler.rb', line 9 def call if ActionView::Base.respond_to?(:annotate_rendered_view_with_filenames) && disable_annotations original_value = ActionView::Base.annotate_rendered_view_with_filenames ActionView::Base.annotate_rendered_view_with_filenames = false res = yield ActionView::Base.annotate_rendered_view_with_filenames = original_value res else yield end end |