Sha256: d2c206edcf90b31adc7f311f6f103ccc3f2d8e7156d44ff54e7a6e54dea44295
Contents?: true
Size: 477 Bytes
Versions: 13
Compression:
Stored size: 477 Bytes
Contents
module Rack::App::Test::SingletonMethods def rack_app(rack_app_class=nil, &constructor) klass = if !rack_app_class.nil? && rack_app_class.respond_to?(:call) rack_app_class else Class.new(Rack::App) end klass.class_eval(&constructor) unless constructor.nil? return in_this_context(:__rack_app_class__){ klass } end def in_this_context(name, &block) let(name, &block) rescue NoMethodError define_method(name, &block) end end
Version data entries
13 entries across 13 versions & 1 rubygems