Class: Extentions::Collection
- Inherits:
-
Object
- Object
- Extentions::Collection
- Defined in:
- lib/extentions.rb
Defined Under Namespace
Classes: Presenter
Instance Method Summary collapse
- #build_presenter ⇒ Object
-
#initialize(model, extentions) ⇒ Collection
constructor
A new instance of Collection.
- #process!(*params) ⇒ Object
Constructor Details
#initialize(model, extentions) ⇒ Collection
Returns a new instance of Collection.
34 35 36 37 |
# File 'lib/extentions.rb', line 34 def initialize(model, extentions) @extentions = extentions @model = model end |
Instance Method Details
#build_presenter ⇒ Object
45 46 47 48 49 50 |
# File 'lib/extentions.rb', line 45 def build_presenter rendered = extentions.each_with_object({}) do |extention, rendered| rendered[extention.to_token] = -> { extention.render } end Presenter.new(model, rendered) end |
#process!(*params) ⇒ Object
39 40 41 42 43 |
# File 'lib/extentions.rb', line 39 def process!(*params) extentions.each do |extention| extention.process(*params) end end |