Class: PasswordRequired::PasswordRequest::HiddenInputs

Inherits:
Object
  • Object
show all
Includes:
ActionView::Helpers::FormTagHelper
Defined in:
lib/password_required/password_request/hidden_inputs.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params, namespaces: []) ⇒ HiddenInputs

Returns a new instance of HiddenInputs.



8
9
10
11
# File 'lib/password_required/password_request/hidden_inputs.rb', line 8

def initialize(params, namespaces: [])
  @params = params
  @namespaces = namespaces
end

Instance Attribute Details

#namespacesObject (readonly)

Returns the value of attribute namespaces.



6
7
8
# File 'lib/password_required/password_request/hidden_inputs.rb', line 6

def namespaces
  @namespaces
end

Instance Method Details

#to_sObject



13
14
15
16
17
# File 'lib/password_required/password_request/hidden_inputs.rb', line 13

def to_s
  @params.reduce('') do |input_html, key_value_pair|
    input_html + input_from(*key_value_pair)
  end
end