Class: Hash
- Inherits:
-
Object
- Object
- Hash
- Defined in:
- lib/serviceable.rb
Instance Method Summary collapse
Instance Method Details
#&(other) ⇒ Object
2 3 4 |
# File 'lib/serviceable.rb', line 2 def &(other) reject {|k,v| !(other.include?(k) && ([v]&[other[k]]).any?)} end |
#compact ⇒ Object
5 6 7 |
# File 'lib/serviceable.rb', line 5 def compact reject {|k,v| k.nil? || v.nil?} end |