Module: Fend::Plugins::ObjectValidation::ParamMethods
- Defined in:
- lib/fend/plugins/object_validation.rb
Instance Method Summary collapse
Instance Method Details
#attrs(*names) {|attrs.values| ... } ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/fend/plugins/object_validation.rb', line 42 def attrs(*names, &block) return if flat? && invalid? attrs = names.each_with_object({}) do |name, result| attr = _build_param(name, @value.public_send(name)) result[name] = attr end yield(*attrs.values) attrs.each { |name, attr| _nest_errors(name, attr.errors) if attr.invalid? } end |