Class: BasePresenter
- Inherits:
-
Object
- Object
- BasePresenter
- Defined in:
- app/presenters/base_presenter.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#context ⇒ Object
(also: #h)
readonly
Returns the value of attribute context.
-
#model ⇒ Object
(also: #m)
readonly
Returns the value of attribute model.
Instance Method Summary collapse
-
#initialize(model, context) ⇒ BasePresenter
constructor
A new instance of BasePresenter.
- #method_missing(name, *args, &block) ⇒ Object
- #respond_to?(name, include_all = false) ⇒ Boolean
Constructor Details
#initialize(model, context) ⇒ BasePresenter
Returns a new instance of BasePresenter.
6 7 8 |
# File 'app/presenters/base_presenter.rb', line 6 def initialize(model, context) @model, @context = model, context end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
10 11 12 |
# File 'app/presenters/base_presenter.rb', line 10 def method_missing(name, *args, &block) m.__send__(name, *args, &block) end |
Instance Attribute Details
#context ⇒ Object (readonly) Also known as: h
Returns the value of attribute context.
2 3 4 |
# File 'app/presenters/base_presenter.rb', line 2 def context @context end |
#model ⇒ Object (readonly) Also known as: m
Returns the value of attribute model.
2 3 4 |
# File 'app/presenters/base_presenter.rb', line 2 def model @model end |
Instance Method Details
#respond_to?(name, include_all = false) ⇒ Boolean
14 15 16 |
# File 'app/presenters/base_presenter.rb', line 14 def respond_to?(name, include_all = false) super || m.respond_to?(name, include_all) end |