I would like to add methods to my template through a Presenter, but some methods are shared among other presenters.
Ex: os métodos 'pode_ser_mostrado?', 'pode_ser_editado?', 'pode_ser_excluido?'
What is the best way, to create a base presenter to be extended by others ?, or create a mixin included by the presenters?
Example:
class ModeloPresenter < BasePresenter
end
or
class ModeloPresenter
include 'base_presenter'
end
In case how to implement?
Example how to use the methods:
<%= link_to 'Mostrar', show_usuario(usuario.id) if UsuarioPresenter.pode_ser_mostrado? %>
<%= link_to 'Mostrar', show_cliente(cliente.id) if ClientePresenter.pode_ser_mostrado? %>
<%= link_to 'Mostrar', show_local(local.id) if LocalPresenter.pode_ser_mostrado? %>
I also accept if there is a suggestion for a better way to implement it.