Class: Crowbar::Client::Filter::Hash

Inherits:
Base
  • Object
show all
Defined in:
lib/crowbar/client/filter/hash.rb

Overview

Filter to reduce a hash by a given search clause

Instance Attribute Summary

Attributes inherited from Base

#options

Instance Method Summary collapse

Methods inherited from Base

#initialize, #result

Constructor Details

This class inherits a constructor from Crowbar::Client::Filter::Base

Instance Method Details

#processObject



24
25
26
27
28
29
30
31
32
# File 'lib/crowbar/client/filter/hash.rb', line 24

def process
  options[:values].select do |row|
    result = row.values.map do |value|
      value.to_s.include? options[:filter]
    end

    result.include? true
  end
end