programandoarg/pg_rails

View on GitHub
pg_engine/app/components/base_component.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
class BaseComponent < ViewComponent::Base
  def alert_wrapped(view_context)
    AlertComponent.new(type: alert_type)
                  .with_content(render_in(view_context))
  end

  def alert_type
    # :nocov:
    raise 'implement in subclass'
    # :nocov:
  end
end