Module: RailsCacheInspector::FragmentForPatch

Defined in:
lib/rails-cache-inspector/fragment_for_patch.rb

Instance Method Summary collapse

Instance Method Details

#fragment_for(name = {}, options = nil, &block) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/rails-cache-inspector/fragment_for_patch.rb', line 3

def fragment_for(name = {}, options = nil, &block)
  fragment   = super(name, options, &block)
  style      = RailsCacheInspector.configuration.highlight_with[:style]
  class_name = RailsCacheInspector.configuration.highlight_with[:class_name]

  <<-HTML.strip_heredoc
    <div style="#{style}" class="#{class_name}">
      #{fragment}
    </div>
  HTML
end