Class: Jets::Controller::Base
- Inherits:
-
Lambda::Functions
- Object
- Lambda::Functions
- Jets::Controller::Base
- Defined in:
- lib/jets/controller/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#request ⇒ Object
readonly
Returns the value of attribute request.
Attributes inherited from Lambda::Functions
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(event, context = {}, meth) ⇒ Base
constructor
A new instance of Base.
Methods included from Params
Methods included from Rendering
#actual_host, #add_stage_name, #adjust_content_type!, #default_layout, #default_options, #ensure_render, #normalize_options, #render, #url_for
Methods included from Redirection
#ensure_protocol, #redirect_to
Methods included from Lambda::Dsl
Constructor Details
Instance Attribute Details
#request ⇒ Object (readonly)
Returns the value of attribute request.
35 36 37 |
# File 'lib/jets/controller/base.rb', line 35 def request @request end |
Class Method Details
.internal(value = nil) ⇒ Object
42 43 44 45 46 47 48 |
# File 'lib/jets/controller/base.rb', line 42 def self.internal(value=nil) if !value.nil? self.internal_controller = value else self.internal_controller end end |
.process(event, context = {}, meth) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/jets/controller/base.rb', line 14 def self.process(event, context={}, meth) t1 = Time.now Jets.logger.info "Processing by #{self}##{meth}" controller = new(event, context, meth) Jets.logger.info " Event: #{event.inspect}" Jets.logger.info " Parameters: #{controller.params(true).to_h.inspect}" controller.run_before_actions controller.send(meth) resp = controller.ensure_render controller.run_after_actions time = Time.now - t1 Jets.logger.info "Completed Status Code #{resp["statusCode"]} in #{time}s" resp end |