Module: Attribution::Util
- Defined in:
- lib/attribution/util.rb
Class Method Summary collapse
-
.extract_values(hash, *keys) ⇒ Object
Returns an array of the values that match each key, up until the point at which it finds a blank value.
Class Method Details
.extract_values(hash, *keys) ⇒ Object
Returns an array of the values that match each key, up until the point at which it finds a blank value.
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/attribution/util.rb', line 11 def self.extract_values(hash, *keys) values = [] keys.each do |key| value = hash[key] if value.present? values << value else break end end values end |