Class: PasswordRequired::PasswordRequest
- Inherits:
-
Object
- Object
- PasswordRequired::PasswordRequest
- Includes:
- ActiveModel::Model
- Defined in:
- lib/password_required/password_request.rb,
lib/password_required/password_request/hidden_inputs.rb
Defined Under Namespace
Classes: HiddenInputs
Constant Summary collapse
- IGNORED_PARAMETER_KEYS =
[:action, :controller]
Instance Attribute Summary collapse
-
#password ⇒ Object
Returns the value of attribute password.
Instance Method Summary collapse
- #additional_params ⇒ Object
- #hidden_form_inputs ⇒ Object
-
#initialize(request) ⇒ PasswordRequest
constructor
A new instance of PasswordRequest.
- #target_url ⇒ Object
Constructor Details
#initialize(request) ⇒ PasswordRequest
Returns a new instance of PasswordRequest.
13 14 15 16 |
# File 'lib/password_required/password_request.rb', line 13 def initialize(request) @request = request super({}) end |
Instance Attribute Details
#password ⇒ Object
Returns the value of attribute password.
11 12 13 |
# File 'lib/password_required/password_request.rb', line 11 def password @password end |
Instance Method Details
#additional_params ⇒ Object
22 23 24 |
# File 'lib/password_required/password_request.rb', line 22 def additional_params parameters.except(*IGNORED_PARAMETER_KEYS) end |
#hidden_form_inputs ⇒ Object
26 27 28 |
# File 'lib/password_required/password_request.rb', line 26 def hidden_form_inputs HiddenInputs.new(additional_params).to_s.html_safe end |
#target_url ⇒ Object
18 19 20 |
# File 'lib/password_required/password_request.rb', line 18 def target_url env['ORIGINAL_FULLPATH'] end |