contacts_txt 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/contacts_txt.rb +12 -1
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b1275007e1f8ef531ebeee9f8a3fda50991d07f
|
4
|
+
data.tar.gz: fa8cb894c0defecdd41b9dc15fe84fbf90262467
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 660552a683c9c1b5bc933f0a0a558ac06a904f575b936fc8ff1e0959b5c620b347833b8eb5f0dcfce706288cf13845840b754ce50a92ddf956fcc2664da1c13e
|
7
|
+
data.tar.gz: 3c82b345017bfdbeb3138d542fc13eaa731fc34e8a5bbfe966062b75514813ff1fb64de6d7f4c887fe7427c278dcfa02f0a9bc19777975cd7898ab5327047206
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/contacts_txt.rb
CHANGED
@@ -9,7 +9,8 @@ class ContactsTxt
|
|
9
9
|
|
10
10
|
attr_reader :to_s
|
11
11
|
|
12
|
-
def initialize(src=nil, fields: %w(
|
12
|
+
def initialize(src=nil, fields: %w(role organisation mobile
|
13
|
+
sms email dob tags address notes),
|
13
14
|
username: nil, password: nil)
|
14
15
|
|
15
16
|
@fields = %w(fullname firstname lastname tel) | fields
|
@@ -36,6 +37,16 @@ class ContactsTxt
|
|
36
37
|
def dx()
|
37
38
|
@dx
|
38
39
|
end
|
40
|
+
|
41
|
+
def find_by_name(raw_name)
|
42
|
+
|
43
|
+
name = Regexp.new raw_name
|
44
|
+
|
45
|
+
@dx.all.select do |x|
|
46
|
+
x.fullname =~ name or x.firstname =~ name or x.lastname =~ name
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
39
50
|
|
40
51
|
# returns a Dynarex object
|
41
52
|
#
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|