Class: Presenter
- Inherits:
-
Object
- Object
- Presenter
- Defined in:
- app/presenters/presenter.rb
Direct Known Subclasses
ResourcePresenter, Resources::General::Wizards::Story::Steps::ActivatePresenter, Resources::General::Wizards::Story::Steps::SetupTasksPresenter, Shared::Collection::TablePresenter
Instance Method Summary collapse
-
#initialize(subject, options = {}) ⇒ Presenter
constructor
A new instance of Presenter.
- #set_option(option, value) ⇒ Object
- #set_options(options) ⇒ Object
Constructor Details
#initialize(subject, options = {}) ⇒ Presenter
Returns a new instance of Presenter.
2 3 4 5 |
# File 'app/presenters/presenter.rb', line 2 def initialize(subject, = {}) @subject = subject () end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(*args, &block) ⇒ Object (private)
39 40 41 42 43 44 45 |
# File 'app/presenters/presenter.rb', line 39 def method_missing(*args, &block) if args.is_a?(Array) && @options.has_key?(args.first) @options[args.first] else @subject.send(*args, &block) end end |
Instance Method Details
#set_option(option, value) ⇒ Object
15 16 17 |
# File 'app/presenters/presenter.rb', line 15 def set_option(option, value) @options[option] = value end |
#set_options(options) ⇒ Object
11 12 13 |
# File 'app/presenters/presenter.rb', line 11 def () raise NotImplementedError end |