module CrossOrigin

Constants

VERSION

Public Class Methods

[](origin) click to toggle source
# File lib/cross_origin.rb, line 18
def [](origin)
  origin_options[to_name(origin)]
end
config(origin, options = {}) click to toggle source
# File lib/cross_origin.rb, line 22
def config(origin, options = {})
  origin = to_name(origin)
  fail "Not allowed for origin name: #{origin}" if origin == :default
  origin_options[origin] || (origin_options[origin] = Config.new(origin, options))
end
configurations() click to toggle source
# File lib/cross_origin.rb, line 28
def configurations
  origin_options.values
end
names() click to toggle source
# File lib/cross_origin.rb, line 32
def names
  origin_options.keys
end
to_name(origin) click to toggle source
# File lib/cross_origin.rb, line 10
def to_name(origin)
  if origin.is_a?(Symbol)
    origin
  else
    origin.to_s.to_sym
  end
end

Private Class Methods

origin_options() click to toggle source
# File lib/cross_origin.rb, line 38
def origin_options
  @origin_options ||= {}
end