Class: UPresenter::CollectionBase

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/u_presenter/collection_base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(collection, presenter_class, view_context = nil) ⇒ CollectionBase

Returns a new instance of CollectionBase.



5
6
7
8
9
10
# 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

Instance Attribute Details

#collectionObject (readonly)

Returns the value of attribute collection.



3
4
5
# File 'lib/u_presenter/collection_base.rb', line 3

def collection
  @collection
end

Instance Method Details

#presentedObject



12
13
14
# File 'lib/u_presenter/collection_base.rb', line 12

def presented
  @presented ||= present_collection
end