Class: Captcha::CaptchaVerificationService::RequestStruct

Inherits:
Struct
  • Object
show all
Defined in:
app/services/captcha/captcha_verification_service.rb

Overview

Currently the only value that is used out of the request by the reCAPTCHA library is 'remote_ip'. Therefore, we just create a struct to avoid passing the full request object through all the service layer objects, and instead just rely on passing only the required remote_ip value. This eliminates the need to couple the service layer to the HTTP request (for the purpose of this service, at least).

Instance Attribute Summary collapse

Instance Attribute Details

#remote_ipObject

Returns the value of attribute remote_ip

Returns:

  • (Object)

    the current value of remote_ip


15
16
17
# File 'app/services/captcha/captcha_verification_service.rb', line 15

def remote_ip
  @remote_ip
end