Class: Navigable::Server::CORS

Inherits:
Object
  • Object
show all
Defined in:
lib/navigable/server/cors.rb

Defined Under Namespace

Classes: Middleware

Class Method Summary collapse

Class Method Details

.config {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



5
6
7
# File 'lib/navigable/server/cors.rb', line 5

def config
  yield(self)
end

.headersObject



9
10
11
# File 'lib/navigable/server/cors.rb', line 9

def headers
  @headers ||= {}
end

.headers=(headers) ⇒ Object

Raises:

  • (ArgumentError)


13
14
15
16
17
# File 'lib/navigable/server/cors.rb', line 13

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