Class: NYNY::App

Inherits:
Base
  • Object
show all
Defined in:
lib/nyny/app.rb

Constant Summary

Constants inherited from Base

Base::HTTP_VERBS

Class Method Summary collapse

Methods inherited from Base

after, after_initialize, before, before_initialize, #call, constraints, define_route, helpers, #initialize, namespace, register, use

Methods included from Inheritable

included

Constructor Details

This class inherits a constructor from NYNY::Base

Class Method Details

.configure(*envs, &block) ⇒ Object



13
14
15
16
17
# File 'lib/nyny/app.rb', line 13

def configure *envs, &block
  if envs.map(&:to_sym).include?(NYNY.env.to_sym) or envs.empty?
    instance_eval(&block)
  end
end

.run!(port = 9292) ⇒ Object



19
20
21
22
23
# File 'lib/nyny/app.rb', line 19

def run! port=9292
  use Rack::CommonLogger
  use BetterErrors::Middleware unless NYNY.env.production?
  Rack::Handler.pick(['puma', 'thin', 'webrick']).run new, :Port => port
end