Class: Cyrax::Presenter
Instance Attribute Summary
Attributes inherited from Wrapper
#accessor, #options, #resource
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Wrapper
Constructor Details
This class inherits a constructor from Cyrax::Wrapper
Class Method Details
.present(resource, options = {}) ⇒ Object
12 13 14 |
# File 'lib/cyrax/presenter.rb', line 12 def present(resource, = {}) self.new(resource, ).present end |
Instance Method Details
#present ⇒ Object
2 3 4 5 6 7 8 9 |
# File 'lib/cyrax/presenter.rb', line 2 def present should_decorate = [:decorate].nil? || [:decorate] if [:decorator] && should_decorate present_with_decoration(resource, ) else present_without_decoration(resource, ) end end |