faxage 1.0.1 → 1.1.1

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
  SHA256:
3
- metadata.gz: 03e1ea82916fd2129f4ba45c6c5941103a5c9b3740d8ff693cd55c85766bf6c0
4
- data.tar.gz: f7f68525bf09e1f4f26eb7823dcac015f079e69fd73054aad76383c885194f3a
3
+ metadata.gz: cef925b012340a06484d13804bef6028f9e6947c545c5a704e2c7b7d4b68e278
4
+ data.tar.gz: 8aa2da77601b18e6b8fad5f0c0a335e49109fcbd6af028453bd296499639bfd1
5
5
  SHA512:
6
- metadata.gz: 3ac1eb727374238da959b6b4c43f4bd83df8eeb58cfe0776490cd496393b2c404f097b4a73eaf6c570529a825ed50c4d4c9c46a7ad52d6940b8e89d65832efc9
7
- data.tar.gz: 8fcf98f9e153e7c7dd4a26cc36bf2a537453b4bd7c85397113da64c446ba6eb10c0a4312985343f9d50c2f305f9e4d4bfebe805ab5b6528d5efd3d694bceeb6d
6
+ metadata.gz: 05417c5b676dd0b6c7e547bb7f2a96743cd096c7304537f6f463582c5babbd01f644eb011e445734c5b473cf0ef12fa1e4d5e46d924f639a1519672bba7c8174
7
+ data.tar.gz: b68dd6c22a01c949a6140688628047c7a069f3be85b2e718634fbb6d39afe40df8ff1f28a883d966c9ac508c728aba6379db21e74ebd9685dd89abd78f9d108a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- faxage (1.0.1)
4
+ faxage (1.1.1)
5
5
  httparty
6
6
 
7
7
  GEM
@@ -42,7 +42,68 @@ module Faxage
42
42
  elsif response.parsed_response.include?("ERR11: No incoming faxes available")
43
43
  raise NoIncomingFaxesError.new("There are no incoming faxes to list for you.")
44
44
  else
45
- return response.parsed_response
45
+ data = []
46
+ response.parsed_response.split("\n").each do |received_fax|
47
+ # <recvid><tab><recvdate>(OPTIONAL:
48
+ # <tab><starttime>)
49
+ # <tab><CID><tab><DNIS>(OPTIONAL:
50
+ # <tab><filename>)(OPTIONAL:
51
+ # <tab><pagecount>)(OPTIONAL: <tab><tsid>)
52
+ individual_fax = Hash.new
53
+ received_fax.split("\t").each_with_index do |item, index|
54
+ if options[:starttime].nil?
55
+ case index
56
+ when 0
57
+ individual_fax[:recvid] = item
58
+ when 1
59
+ individual_fax[:revdate] = item
60
+ when 2
61
+ individual_fax[:cid] = item
62
+ when 3
63
+ individual_fax[:dnis] = item
64
+ when 4 && !options[:filename].nil?
65
+ individual_fax[:filename] = item
66
+ when 4 && options[:filename].nil? && !options[:pagecount].nil?
67
+ individual_fax[:pagecount] = item
68
+ when 4 && options[:filename].nil? && options[:pagecount].nil? && !options[:tsid].nil?
69
+ individual_fax[:tsid] = item
70
+ when 5 && !options[:filename].nil? && !options[:pagecount].nil?
71
+ individual_fax[:pagecount] = item
72
+ when 5 && !options[:filename].nil? && options[:pagecount].nil? && !options[:tsid].nil?
73
+ individual_fax[:tsid] = item
74
+ when 6 && !options[:filename].nil? && !options[:pagecount].nil? && !options[:tsid].nil?
75
+ individual_fax[:tsid] = item
76
+ end
77
+ else
78
+ case index
79
+ when 0
80
+ individual_fax[:recvid] = item
81
+ when 1
82
+ individual_fax[:revdate] = item
83
+ when 2
84
+ individual_fax[:starttime] = item
85
+ when 3
86
+ individual_fax[:cid] = item
87
+ when 4
88
+ individual_fax[:dnis] = item
89
+ when 5 && !options[:filename].nil?
90
+ individual_fax[:filename] = item
91
+ when 5 && options[:filename].nil? && !options[:pagecount].nil?
92
+ individual_fax[:pagecount] = item
93
+ when 5 && options[:filename].nil? && options[:pagecount].nil? && !options[:tsid].nil?
94
+ individual_fax[:tsid] = item
95
+ when 6 && !options[:filename].nil? && !options[:pagecount].nil?
96
+ individual_fax[:pagecount] = item
97
+ when 6 && !options[:filename].nil? && options[:pagecount].nil? && !options[:tsid].nil?
98
+ individual_fax[:tsid] = item
99
+ when 7 && !options[:filename].nil? && !options[:pagecount].nil? && !options[:tsid].nil?
100
+ individual_fax[:tsid] = item
101
+ end
102
+ end
103
+ data << individual_fax
104
+ end
105
+ end
106
+ return data
46
107
  end
47
108
  end
48
109
  end
@@ -1,3 +1,3 @@
1
1
  module Faxage
2
- VERSION = "1.0.1"
2
+ VERSION = "1.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faxage
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Dias