Class: DecentPresenter::Exposure

Inherits:
Object
  • Object
show all
Defined in:
lib/decent_presenter/exposure.rb

Instance Method Summary collapse

Constructor Details

#initialize(view_context, presenter_factory) ⇒ Exposure

Returns a new instance of Exposure.



9
10
11
12
# File 'lib/decent_presenter/exposure.rb', line 9

def initialize(view_context, presenter_factory)
  @view_context = view_context
  @presenter_factory = presenter_factory
end

Instance Method Details

#present(presentable, options = {}) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/decent_presenter/exposure.rb', line 14

def present(presentable, options = {})
  if presentable_is_a_collection?(presentable)
    present_collection(presentable, options)
  else
    present_model(presentable, options)
  end
end