Class: ReCaptcha::Client

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Application
Defined in:
lib/re_captcha/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Application

#recaptcha_valid?

Methods included from API

#post

Constructor Details

#initialize(configuration) ⇒ Client

Returns a new instance of Client.

Raises:



12
13
14
15
16
# File 'lib/re_captcha/client.rb', line 12

def initialize(configuration)
  @configuration = configuration
  @env           = ENV['RACK_ENV'] || ENV['RAILS_ENV'] || 'development'
  raise ConfigurationError.new('Invalid configuration') unless configuration.valid?
end

Instance Attribute Details

#envObject (readonly)

Returns the value of attribute env.



10
11
12
# File 'lib/re_captcha/client.rb', line 10

def env
  @env
end