Questions on Methods from Rails Presenters Tutorial
<p>Question about a couple of methods that I saw in this tutorial: <a href="https://richonrails.com/articles/rails-presenters" rel="nofollow">https://richonrails.com/articles/rails-presenters</a></p>

<p>In particular: </p>

<pre><code>module ApplicationHelper
    def present(model, presenter_class=nil)
        klass = presenter_class || "#{model.class}Presenter".constantize
        presenter = klass.new(model, self)
        yield(presenter) if block_given?
    end
end
</code></pre>

<p>And</p>

<pre><code>class BasePresenter &lt; SimpleDelegator 
    def initialize(model, view)
        @model, @view = model, view
        super(@model)
    end

    def h 
        @view 
    end

end
</code></pre>

<p>How does the <code>present</code> method work? I'm pretty confused about its arguments parameters, ie, <code>model, presenter_class=nil</code> along with the whole method.</p>

<p>And I'm also very confused about <code>model, view</code> arguments as well, and where/what is <code>super(@model)</code> method? </p>

<p>Any information that can explain those methods would be so immensely helpful because I've been staring at it for the past while wondering how the heck they work. </p>