mor 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 911239efa14f5ca3e06c99ad0a620c2912a5ee91
4
- data.tar.gz: a0ba73df8de631933b705f696d85ae596d06f740
3
+ metadata.gz: c5cb357bae3b07adc47856b8ed0d8ab4047f34aa
4
+ data.tar.gz: 2b014d70240842e4f18a337b559bf0b432375fd1
5
5
  SHA512:
6
- metadata.gz: 458453dbb86cbcd0330ce2d0c9c82d5b936f404dbad8712667bb80e85f6bc90467f760a133e47271b150a7dac7caa7b9022e95de7c1288140e380510865484c0
7
- data.tar.gz: 0fca8074bf16453e7aac6ebab90bdfc65e6a4f3728496b689dc74502ba8cb475815bd6c2f455a729f8358d3a9f2e3e8983c42d54b018394d2f626f76d8a3f6a3
6
+ metadata.gz: 5058bd04d296254ce9ad18037ba22ce5249b44c4d6202bd38936418f8049a0e4d7d4f42209a6842ee3e31d2470d65b6de99e4da67332ba8ad544f8195a35771e
7
+ data.tar.gz: ffa866b04161739abae23f887a144aec2daa6ff6838a954af91d2d0f47be151c4d504b77a7905808a49afaef7afe400f29dedf377adc30ef754a521a57189a8e
@@ -43,6 +43,13 @@ module Mor
43
43
  end
44
44
  end
45
45
 
46
+ def find_by hash
47
+ return nil unless hash
48
+ self.all.select{ |app|
49
+ app.attributes.select{ |k,v| hash.keys.include?(k.to_sym) }.values.sort == hash.values.sort
50
+ }.first
51
+ end
52
+
46
53
  def all
47
54
  self.index.map{|id| find(id) }
48
55
  end
@@ -1,3 +1,3 @@
1
1
  module Mor
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Onur Uyar
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-16 00:00:00.000000000 Z
11
+ date: 2014-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler