class UPresenter::CollectionBase
Attributes
collection[R]
Public Class Methods
new(collection, presenter_class, view_context = nil)
click to toggle source
Calls superclass method
# File lib/u_presenter/collection_base.rb, line 5 def initialize(collection, presenter_class, view_context = nil) @collection = collection @presenter_class = presenter_class @view_context = view_context super(@collection) end
Also aliased as: present
Public Instance Methods
presented()
click to toggle source
# File lib/u_presenter/collection_base.rb, line 12 def presented @presented ||= present_collection end
Private Instance Methods
present_collection()
click to toggle source
# File lib/u_presenter/collection_base.rb, line 22 def present_collection @collection.map do |object| @presenter_class.present(object, @view_context) end end