Strelka::App::CORS::

ClassMethods

module

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

anchor
extended( mod )

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

anchor
access_control( uri_pattern=nil, **options, &block )

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
anchor
cors_access_control( uri_pattern=nil, **options, &block )
Alias for: access_control