Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- lib/arisaid/core_ext/array.rb
Instance Method Summary collapse
Instance Method Details
#find_by(name: nil, id: nil) ⇒ Object
2 3 4 5 6 7 8 9 10 |
# File 'lib/arisaid/core_ext/array.rb', line 2 def find_by(name: nil, id: nil) if name self.find { |v| v['name'] == name } elsif id self.find { |v| v['id'] == id } else self end end |