Module: ElocalApiSupport::EnableCors::ClassMethods

Defined in:
lib/elocal_api_support/enable_cors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#cors_allow_headersObject

Returns the value of attribute cors_allow_headers.



9
10
11
# File 'lib/elocal_api_support/enable_cors.rb', line 9

def cors_allow_headers
  @cors_allow_headers
end

#cors_allow_methodsObject

Returns the value of attribute cors_allow_methods.



9
10
11
# File 'lib/elocal_api_support/enable_cors.rb', line 9

def cors_allow_methods
  @cors_allow_methods
end

#cors_allow_originObject

Returns the value of attribute cors_allow_origin.



9
10
11
# File 'lib/elocal_api_support/enable_cors.rb', line 9

def cors_allow_origin
  @cors_allow_origin
end

Instance Method Details

#cors_allow_allObject



10
11
12
13
14
# File 'lib/elocal_api_support/enable_cors.rb', line 10

def cors_allow_all
  self.cors_allow_origin  = '*'
  self.cors_allow_methods = %w(GET POST PUT DELETE).join(',')
  self.cors_allow_headers = %w(Origin Accept Content-Type X-Requested-With X-XSRF-Token).join(',')
end