Class: Matryoshka

Inherits:
Object
  • Object
show all
Defined in:
lib/matryoshka.rb,
lib/matryoshka.rb

Defined Under Namespace

Modules: Document Classes: Answer, Data, External

Constant Summary collapse

ROOT_DIR =
File.expand_path(File.dirname(__FILE__) + '/../')

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app = nil) ⇒ Matryoshka

Returns a new instance of Matryoshka.



20
21
22
# File 'lib/matryoshka.rb', line 20

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

Class Method Details

.mrequire(filename) ⇒ Object



4
5
6
# File 'lib/matryoshka.rb', line 4

def self.mrequire(filename)
  Kernel.require ROOT_DIR + "/lib/matryoshka/#{filename}"
end

Instance Method Details

#applicationObject



24
25
26
# File 'lib/matryoshka.rb', line 24

def application
  @application
end

#call(rack_env) ⇒ Object



28
29
30
31
# File 'lib/matryoshka.rb', line 28

def call(rack_env)
  # puts rack_env['REQUEST_URI']
  Answer.new(rack_env, application).to_rack
end