Class: Vedeu::ApplicationView
- Inherits:
-
Object
- Object
- Vedeu::ApplicationView
- Includes:
- View
- Defined in:
- lib/vedeu/application/application_view.rb
Overview
Provides the mechanism to render views for the client application. The client application’s ApplicationView will inherit from this class.
Instance Attribute Summary collapse
- #params ⇒ Hash protected
Class Method Summary collapse
-
.render(**params) ⇒ void
Renders the view.
Instance Method Summary collapse
-
#initialize(**params) ⇒ Vedeu::ApplicationView
constructor
Returns a new instance of Vedeu::ApplicationView.
- #render ⇒ Object
-
#template(value) ⇒ String
private
Provides the path to the template file using the base_path configuration option.
Methods included from View
Constructor Details
#initialize(**params) ⇒ Vedeu::ApplicationView
Returns a new instance of Vedeu::ApplicationView.
27 28 29 30 31 32 33 |
# File 'lib/vedeu/application/application_view.rb', line 27 def initialize(**params) @params = params @params.each do |key, value| self.class.send(:define_method, key) { value } unless respond_to?(key) end end |
Instance Attribute Details
#params ⇒ Hash (protected)
46 47 48 |
# File 'lib/vedeu/application/application_view.rb', line 46 def params @params end |
Class Method Details
.render(**params) ⇒ void
This method returns an undefined value.
Renders the view.
19 20 21 |
# File 'lib/vedeu/application/application_view.rb', line 19 def self.render(**params) new(params).render end |
Instance Method Details
#render ⇒ Object
Note:
Client applications should implement this method.
38 39 40 |
# File 'lib/vedeu/application/application_view.rb', line 38 def render raise Vedeu::Error::NotImplemented end |