Class: Rebels::Fakes::FakeDB::NonNullFinder

Inherits:
Struct
  • Object
show all
Defined in:
lib/rebels/fakes/fake_db.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#attrsObject

Returns the value of attribute attrs

Returns:

  • (Object)

    the current value of attrs



2
3
4
# File 'lib/rebels/fakes/fake_db.rb', line 2

def attrs
  @attrs
end

Instance Method Details

#to_procObject



3
4
5
# File 'lib/rebels/fakes/fake_db.rb', line 3

def to_proc
  ->(thing) { attrs.select{|k,v| !v.nil?}.all?{|k,v| thing.send(k) == v } }
end