Class: Tzispa::Controller::Base

Inherits:
Object
  • Object
show all
Includes:
Helpers::Hooks::After, Helpers::Hooks::Before
Defined in:
lib/tzispa/controller/base.rb

Direct Known Subclasses

Http, HttpError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app, callmethod, context_class = Tzispa::Context) ⇒ Base



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

def initialize(app, callmethod, context_class = Tzispa::Context)
  @application = app
  @callmethod = callmethod
  @context_class = context_class
end

Instance Attribute Details

#applicationObject (readonly)

Returns the value of attribute application.



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

def application
  @application
end

#callmethodObject (readonly)

Returns the value of attribute callmethod.



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

def callmethod
  @callmethod
end

#contextObject (readonly)

Returns the value of attribute context.



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

def context
  @context
end

#context_classObject (readonly)

Returns the value of attribute context_class.



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

def context_class
  @context_class
end

Instance Method Details

#call(env) ⇒ Object



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

def call(env)
  @context = context_class.new(application, env)
  invoke
end