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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/faxage/receive_fax.rb +62 -1
- data/lib/faxage/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cef925b012340a06484d13804bef6028f9e6947c545c5a704e2c7b7d4b68e278
|
4
|
+
data.tar.gz: 8aa2da77601b18e6b8fad5f0c0a335e49109fcbd6af028453bd296499639bfd1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05417c5b676dd0b6c7e547bb7f2a96743cd096c7304537f6f463582c5babbd01f644eb011e445734c5b473cf0ef12fa1e4d5e46d924f639a1519672bba7c8174
|
7
|
+
data.tar.gz: b68dd6c22a01c949a6140688628047c7a069f3be85b2e718634fbb6d39afe40df8ff1f28a883d966c9ac508c728aba6379db21e74ebd9685dd89abd78f9d108a
|
data/Gemfile.lock
CHANGED
data/lib/faxage/receive_fax.rb
CHANGED
@@ -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
|
-
|
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
|
data/lib/faxage/version.rb
CHANGED