Class: Hanami::Helpers::FormHelper::Values Private
- Inherits:
-
Object
- Object
- Hanami::Helpers::FormHelper::Values
- Defined in:
- lib/hanami/helpers/form_helper/values.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Values from params and form helpers.
It’s responsible to populate input values with data coming from params and inline values specified via form helpers like ‘text_field`.
Constant Summary collapse
- GET_SEPARATOR =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
'.'.freeze
Instance Method Summary collapse
-
#get(*keys) ⇒ Object
private
Returns the value (if present) for the given key.
-
#initialize(values, params) ⇒ Values
constructor
private
A new instance of Values.
Constructor Details
#initialize(values, params) ⇒ Values
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Values.
20 21 22 23 |
# File 'lib/hanami/helpers/form_helper/values.rb', line 20 def initialize(values, params) @values = Utils::Hash.symbolize(values || {}) @params = params end |
Instance Method Details
#get(*keys) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the value (if present) for the given key. Nested values are expressed with an array if symbols.
30 31 32 |
# File 'lib/hanami/helpers/form_helper/values.rb', line 30 def get(*keys) _get_from_params(*keys) || _get_from_values(*keys) end |