simplevcf 0.0.3 → 0.0.5

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.
Files changed (2) hide show
  1. data/lib/simplevcf.rb +12 -2
  2. metadata +1 -1
data/lib/simplevcf.rb CHANGED
@@ -1,9 +1,16 @@
1
- class SimpleVCF
1
+ # A simple class for importing and parsing a .vcf contact file.
2
+ # Currently works only on single vCard per file.
3
+ class SimpleVCF
4
+
5
+ # To import, pass the contents of the file as string
2
6
  def import(vcard)
3
7
  @file_contents = vcard
4
8
  end
9
+
10
+ # The parser strips the beginning and ending sections of
11
+ # a vCard, iterates to create an array of lines and creates # a hash containing fields with respective values.
5
12
  def parse
6
- @fields = Hash.new()
13
+ @fields = Hash.new()
7
14
  @file_contents["BEGIN:VCARD"] = ""
8
15
  @file_contents["END:VCARD"] = ""
9
16
  @lines = @file_contents.split("\n")
@@ -20,6 +27,9 @@ class SimpleVCF
20
27
  end
21
28
  end
22
29
  end
30
+
31
+ # The output returns the contact information in form
32
+ # of a hash.
23
33
  def output
24
34
  return @fields
25
35
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simplevcf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: