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.
-
#time_now ⇒ String
included
from View
Returns the current local time.
Constructor Details
#initialize(**params) ⇒ Vedeu::ApplicationView
Returns a new instance of Vedeu::ApplicationView.
25 26 27 28 29 30 31 |
# File 'lib/vedeu/application/application_view.rb', line 25 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)
44 45 46 |
# File 'lib/vedeu/application/application_view.rb', line 44 def params @params end |
Class Method Details
.render(**params) ⇒ void
This method returns an undefined value.
Renders the view.
17 18 19 |
# File 'lib/vedeu/application/application_view.rb', line 17 def self.render(**params) new(params).render end |
Instance Method Details
#render ⇒ Object
34 35 36 37 38 |
# File 'lib/vedeu/application/application_view.rb', line 34 def render fail Vedeu::Error::NotImplemented, 'The subclass of Vedeu::ApplicationView must implement the #render' \ 'method.' end |
#template(value) ⇒ String (private)
Provides the path to the template file using the base_path configuration option.
53 54 55 56 |
# File 'lib/vedeu/application/application_view.rb', line 53 def template(value) @template = Vedeu.config.base_path + "/app/views/templates/#{value}.erb" end |
#time_now ⇒ String Originally defined in module View
Returns the current local time.