contacts_txt 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 36a091366cefe47c3b1f63b8e884266504b6cb2e
4
- data.tar.gz: 87e0c7b7ca9357aa61eab4ead1fd703fc6f649a1
3
+ metadata.gz: 0b1275007e1f8ef531ebeee9f8a3fda50991d07f
4
+ data.tar.gz: fa8cb894c0defecdd41b9dc15fe84fbf90262467
5
5
  SHA512:
6
- metadata.gz: 1dccaa1c491cc9a1d586d74a3c32b849b6e4f94dcbb126b6a1118ea0c7fdc728e4edaafad93aeaf7bdc5c9e1528dee089904b7e5be51d4ada102de92324a6268
7
- data.tar.gz: 5b5a9da840d7c2c0c5c0766954a83a5d724ec33956f6beca927eb31f4cc6add131d3f8395810c3bea9211da7e01178b1a443bc1f83ae905300863c641cb16b60
6
+ metadata.gz: 660552a683c9c1b5bc933f0a0a558ac06a904f575b936fc8ff1e0959b5c620b347833b8eb5f0dcfce706288cf13845840b754ce50a92ddf956fcc2664da1c13e
7
+ data.tar.gz: 3c82b345017bfdbeb3138d542fc13eaa731fc34e8a5bbfe966062b75514813ff1fb64de6d7f4c887fe7427c278dcfa02f0a9bc19777975cd7898ab5327047206
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -9,7 +9,8 @@ class ContactsTxt
9
9
 
10
10
  attr_reader :to_s
11
11
 
12
- def initialize(src=nil, fields: %w(mobile email dob tags address notes),
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
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contacts_txt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file