Class: DecentPresenter::Exposure
- Inherits:
-
Object
- Object
- DecentPresenter::Exposure
- Defined in:
- lib/decent_presenter/exposure.rb
Instance Method Summary collapse
-
#initialize(view_context, presenter_factory) ⇒ Exposure
constructor
A new instance of Exposure.
- #present(presentable, options = {}) ⇒ Object
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, = {}) if presentable_is_a_collection?(presentable) present_collection(presentable, ) else present_model(presentable, ) end end |