Class: Stacko::Application

Inherits:
Object
  • Object
show all
Defined in:
lib/stacko/application.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.builderObject



3
4
5
# File 'lib/stacko/application.rb', line 3

def self.builder
  @builder ||= Builder.new
end

.map(method_name, &block) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/stacko/application.rb', line 7

def self.map(method_name, &block)
  builder.map(method_name, &block)
  class_eval <<-EOT, __FILE__, __LINE__ + 1
    def #{method_name}(*args)                  # def get_user(*args)
      execute(:#{method_name}, *args)          #   execute(:get_user, *args)
    end                                        # end
  EOT
end

.run(app) ⇒ Object



16
17
18
# File 'lib/stacko/application.rb', line 16

def self.run(app)
  builder.run(app)
end

.use(middleware, *args, &block) ⇒ Object



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

def self.use(middleware, *args, &block)
  builder.use(middleware, *args, &block)
end

Instance Method Details

#call(*args) ⇒ Object



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

def call(*args)
  execute(:call, *args)
end