Module: Finitio::Support
- Defined in:
- lib/finitio/support.rb
Class Method Summary collapse
Class Method Details
.compare_attrs(h1, h2, &bl) ⇒ Object
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/finitio/support.rb', line 4 def compare_attrs(h1, h2, &bl) mine, yours = if bl [h1.map(&bl), h2.map(&bl)] elsif h1.is_a?(Hash) [h1.keys, h2.keys] else [h1, h2] end [ mine & yours, mine - yours, yours - mine ] end |