Method: Sinatra::Base#initialize

Defined in:
lib/sinatra/base.rb

#initialize(app = nil, **_kwargs) {|_self| ... } ⇒ Base

Returns a new instance of Base.

Yields:

  • (_self)

Yield Parameters:

  • _self (Sinatra::Base)

    the object that the method was called on

[View source]

983
984
985
986
987
988
989
# File 'lib/sinatra/base.rb', line 983

def initialize(app = nil, **_kwargs)
  super()
  @app = app
  @template_cache = TemplateCache.new
  @pinned_response = nil # whether a before! filter pinned the content-type
  yield self if block_given?
end