Class: Tzispa::Controller::Base

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Helpers::ErrorView
Defined in:
lib/tzispa/controller/base.rb

Direct Known Subclasses

Api, AuthLayout, HttpError, Layout

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app, callmethod = nil) ⇒ Base

Returns a new instance of Base.



18
19
20
21
# File 'lib/tzispa/controller/base.rb', line 18

def initialize(app, callmethod=nil)
  @callmethod = callmethod
  @application = app
end

Instance Attribute Details

#applicationObject (readonly)

Returns the value of attribute application.



15
16
17
# File 'lib/tzispa/controller/base.rb', line 15

def application
  @application
end

#contextObject (readonly)

Returns the value of attribute context.



15
16
17
# File 'lib/tzispa/controller/base.rb', line 15

def context
  @context
end

Instance Method Details

#call(env) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/tzispa/controller/base.rb', line 23

def call(env)
  @context = Tzispa::Http::Context.new(@application, env)
  #env[Tzispa::ENV_TZISPA_CONTEXT] = @context
  #@context = env[Tzispa::ENV_TZISPA_CONTEXT]
  invoke @callmethod if @callmethod
  response.finish
end