Module: CORS::Policy::ClassMethods
- Defined in:
- lib/cors/policy.rb
Overview
Class methods added to includers of CORS::Policy.
Instance Attribute Summary collapse
- #rules ⇒ CORS::Rules readonly
Instance Method Summary collapse
-
#create {|rules| ... } ⇒ Object
Create an instance of this policy, declaring rules as well.
Instance Attribute Details
Instance Method Details
#create {|rules| ... } ⇒ Object
Create an instance of this policy, declaring rules as well.
45 46 47 48 49 50 51 52 53 |
# File 'lib/cors/policy.rb', line 45 def create(*, &block) unless block_given? raise ArgumentError, "manifest rules must be specified by a block, no block given" end Class.new(self) do @rules = CORS::Rules.new(&block) end end |