Class: NYNY::App
Constant Summary
Constants inherited from Base
Class Method Summary collapse
Methods inherited from Base
after, after_initialize, before, before_initialize, #call, constraints, define_route, helpers, #initialize, register, use
Methods included from Inheritable
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 |
.namespace(url, &block) ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/nyny/app.rb', line 19 def namespace url, &block scope = self.scope_class klass = Class.new self.superclass do self.scope_class = scope class_eval(&block) end builder.map (url) { use klass } end |