module Strelka::App::CORS::ClassMethods
Class methods to add to including applications
Attributes
access_controls[R]
An Array of access control tuples of the form:
[ <uri_pattern>, <options_hash> ]
Public Class Methods
extended( mod )
click to toggle source
Extension hook. Add instance variables to extended classes.
# File lib/strelka/app/cors.rb, line 35 def self::extended( mod ) mod.instance_variable_set( :@access_controls, [] ) end
Public Instance Methods
access_control( uri_pattern=nil, **options, &block )
click to toggle source
Get/declare access control rules for requests whose app_path matches the specified uri_pattern
, and whose other attributes match the given options
.
# File lib/strelka/app/cors.rb, line 48 def access_control( uri_pattern=nil, **options, &block ) options[ :block ] = block if block self.access_controls << [ uri_pattern, options ] end
Also aliased as: cors_access_control