Class: Fend::Plugins::FullMessages::Generator
- Inherits:
-
Object
- Object
- Fend::Plugins::FullMessages::Generator
- Defined in:
- lib/fend/plugins/full_messages.rb
Instance Method Summary collapse
- #call(errors) ⇒ Object
-
#initialize(opts = {}) ⇒ Generator
constructor
A new instance of Generator.
Constructor Details
#initialize(opts = {}) ⇒ Generator
Returns a new instance of Generator.
64 65 66 67 |
# File 'lib/fend/plugins/full_messages.rb', line 64 def initialize(opts = {}) @array_params = opts.fetch(:array_member_names, {}) @skip_list = opts[:skip] end |
Instance Method Details
#call(errors) ⇒ Object
69 70 71 72 73 74 75 76 77 |
# File 'lib/fend/plugins/full_messages.rb', line 69 def call(errors) errors.each_with_object({}) do |(param_name, ), result| result[param_name] = if @skip_list.include?(param_name) else (param_name, ) end end end |