Module: Wallaby::FieldUtils
- Defined in:
- lib/utils/wallaby/field_utils.rb
Overview
Field utils
Class Method Summary collapse
-
.first_field_by(*conditions, fields) ⇒ String, Symbol
Find the first field that meets the first condition.
Class Method Details
.first_field_by(*conditions, fields) ⇒ String, Symbol
Find the first field that meets the first condition.
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/utils/wallaby/field_utils.rb', line 15 def first_field_by(*conditions, fields) return if [conditions, fields].any?(&:blank?) conditions.each do |condition| fields.each do |field_name, | return field_name if meet? condition, field_name, end end nil end |