Class: Tzispa::Controller::Base

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

Direct Known Subclasses

Api, HttpError, Layout

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app, callmethod = nil) ⇒ Base

Returns a new instance of Base.



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

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

Instance Attribute Details

#applicationObject (readonly)

Returns the value of attribute application.



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

def application
  @application
end

#callmethodObject (readonly)

Returns the value of attribute callmethod.



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

def callmethod
  @callmethod
end

#contextObject (readonly)

Returns the value of attribute context.



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

def context
  @context
end

Instance Method Details

#call(env) ⇒ Object



29
30
31
32
33
# File 'lib/tzispa/controller/base.rb', line 29

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