Class: Liberty::CORS
- Inherits:
-
Object
- Object
- Liberty::CORS
- Defined in:
- lib/liberty/cors.rb,
lib/liberty/cors/middleware.rb
Defined Under Namespace
Classes: Middleware
Class Method Summary collapse
Class Method Details
.config {|_self| ... } ⇒ Object
8 9 10 |
# File 'lib/liberty/cors.rb', line 8 def config yield(self) end |
.headers ⇒ Object
12 13 14 |
# File 'lib/liberty/cors.rb', line 12 def headers @headers ||= {} end |
.headers=(headers) ⇒ Object
16 17 18 19 20 |
# File 'lib/liberty/cors.rb', line 16 def headers=(headers) raise ArgumentError.new("Expected headers to be a Hash, received a #{headers.class} instead") unless headers.is_a?(Hash) @headers = headers end |