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

Returns a new instance of Base.



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

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.



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

def application
  @application
end

#callmethodObject (readonly)

Returns the value of attribute callmethod.



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

def callmethod
  @callmethod
end

#contextObject (readonly)

Returns the value of attribute context.



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

def context
  @context
end

#context_classObject (readonly)

Returns the value of attribute context_class.



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

def context_class
  @context_class
end

Instance Method Details

#call(env) ⇒ Object



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

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