Class: Turnstile::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/turnstile/configuration.rb

Constant Summary collapse

DEFAULTS =
{
  enabled: true,
  server_url: "https://challenges.cloudflare.com/turnstile/v0/siteverify",
  script_url: "https://challenges.cloudflare.com/turnstile/v0/api.js"
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



12
13
14
15
16
17
# File 'lib/turnstile/configuration.rb', line 12

def initialize
  @enabled = DEFAULTS[:enabled]
  @server_url = DEFAULTS[:server_url]
  @script_url = DEFAULTS[:script_url]
  @on_failure = nil
end

Instance Attribute Details

#enabledObject

Returns the value of attribute enabled.



10
11
12
# File 'lib/turnstile/configuration.rb', line 10

def enabled
  @enabled
end

#on_failureObject

Returns the value of attribute on_failure.



10
11
12
# File 'lib/turnstile/configuration.rb', line 10

def on_failure
  @on_failure
end

#script_urlObject

Returns the value of attribute script_url.



10
11
12
# File 'lib/turnstile/configuration.rb', line 10

def script_url
  @script_url
end

#secret_keyObject

Returns the value of attribute secret_key.



10
11
12
# File 'lib/turnstile/configuration.rb', line 10

def secret_key
  @secret_key
end

#server_urlObject

Returns the value of attribute server_url.



10
11
12
# File 'lib/turnstile/configuration.rb', line 10

def server_url
  @server_url
end

#site_keyObject

Returns the value of attribute site_key.



10
11
12
# File 'lib/turnstile/configuration.rb', line 10

def site_key
  @site_key
end