Module: Bonobot::Findable::ClassMethods

Defined in:
lib/bonobot/findable.rb

Instance Method Summary collapse

Instance Method Details

#find_by(attributes) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/bonobot/findable.rb', line 9

def find_by(attributes)
  all.select do |local_file|
    attributes.all? do |key, value|
      local_file.try(key) == value
    end
  end
end