Module: S2P::ComponentDebugger

Defined in:
lib/s2p/component.rb

Constant Summary collapse

DEBUG_TEMPLATE =
<<-ERB
  <div class="border border-solid p-3 border-danger">
    <strong><pre><%= c.class %></pre></strong>
    
    <% if c.respond_to?(:debugging_info) %>
      <pre><%= c.debugging_info.pretty_inspect %></pre>
    <% end %>
  </div>
ERB

Instance Method Summary collapse

Instance Method Details

#to_htmlObject



63
64
65
66
67
68
69
# File 'lib/s2p/component.rb', line 63

def to_html
  if self.class.const_defined?(:DEBUG_TEMPLATE)
    t(self.class::DEBUG_TEMPLATE, c: self, x: self.x)
  else
    t(DEBUG_TEMPLATE, c: self, x: self.x)
  end
end