srfax 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +3 -3
- data/lib/srfax.rb +5 -11
- data/lib/srfax/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 519cae942398f436ad1d601bbfe3822e7a9c7da2
|
4
|
+
data.tar.gz: 7183876eafd95a9a0ce73666f4a3079862b59ec3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a81ce3671da581a5316da5dc11eef082f4e5523402f9cae8f73fc3cd01b2ccd06f5b4f4a6d75d66ea79c68e0c91f3205915fa8ff6bedda93973f2bbe649cf09f
|
7
|
+
data.tar.gz: 11989c4fc28a8dadafe7d0eac38f8dbac0b92e8c39e6b381599b9c53d3beb5a008dfa636a7437006867e856ebd8e9e6042b8c0b6069ed0c272b406edf2c75399
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -7,7 +7,7 @@ This is the 'unofficial' SRFax (http://www.srfax.com) API wrapper for ruby. The
|
|
7
7
|
Add this line to your application's Gemfile:
|
8
8
|
|
9
9
|
```ruby
|
10
|
-
gem '
|
10
|
+
gem 'srfax'
|
11
11
|
```
|
12
12
|
|
13
13
|
And then execute:
|
@@ -16,7 +16,7 @@ And then execute:
|
|
16
16
|
|
17
17
|
Or install it yourself using:
|
18
18
|
|
19
|
-
$ gem install
|
19
|
+
$ gem install srfax
|
20
20
|
|
21
21
|
## Usage
|
22
22
|
|
@@ -29,7 +29,7 @@ require 'srfax'
|
|
29
29
|
SrFax.setup do |config|
|
30
30
|
config.defaults[:access_id] = '1234'
|
31
31
|
config.defaults[:access_pwd] = 'password'
|
32
|
-
config.
|
32
|
+
config.logger = Rails.logger
|
33
33
|
end
|
34
34
|
|
35
35
|
SrFax.view_inbox
|
data/lib/srfax.rb
CHANGED
@@ -35,14 +35,8 @@ module SrFax
|
|
35
35
|
sResponseFormat: 'JSON' # XML or JSON
|
36
36
|
}
|
37
37
|
|
38
|
-
mattr_accessor :connection_defaults
|
39
|
-
# Default values to use with the RestClient connection
|
40
|
-
@@connection_defaults = {
|
41
|
-
timeout: 180
|
42
|
-
}
|
43
|
-
|
44
38
|
mattr_accessor :logger
|
45
|
-
# Logger object for use in standalone mode or with Rails
|
39
|
+
# Logger object for use in standalone mode or with Rails.
|
46
40
|
if defined?(Rails)
|
47
41
|
@@logger = Rails.logger
|
48
42
|
else
|
@@ -90,7 +84,7 @@ module SrFax
|
|
90
84
|
res = execute(postVariables)
|
91
85
|
|
92
86
|
if res[:Status] != 'Failure'
|
93
|
-
faxcount = res['Result'].
|
87
|
+
faxcount = res['Result'].length
|
94
88
|
faxcount > 0 ? logger.debug("Found #{faxcount} new fax(es)") : logger.debug('No faxes found matching that criteria')
|
95
89
|
end
|
96
90
|
|
@@ -109,7 +103,7 @@ module SrFax
|
|
109
103
|
# Example Payload for Return:
|
110
104
|
# {"Status"=>"Success", "Result"=>[{"UserID"=>1234, "Period"=>"ALL",
|
111
105
|
# "ClientName"=>nil, "SubUserID"=>0, "BillingNumber"=>"8888888888", "NumberOfFaxes"=>5, "NumberOfPages"=>8}]}
|
112
|
-
def view_usage(
|
106
|
+
def view_usage(options = {})
|
113
107
|
logger.debug 'Viewing fax usage from cloud service'
|
114
108
|
postVariables = { action: 'Get_Fax_Usage' }
|
115
109
|
res = execute(postVariables)
|
@@ -124,13 +118,13 @@ module SrFax
|
|
124
118
|
# @option options [String] :sEndDate Used with :sPeriod and denotes the period to endd at. Format is 'YYYYMMDD'
|
125
119
|
# @option options [String] :sIncludeSubUsers Include subuser accounts ('Y' or 'N')
|
126
120
|
# @return [Hash] A hash containing the return value (Success/Failure) and the payload where applicable
|
127
|
-
def view_outbox(
|
121
|
+
def view_outbox(options = {})
|
128
122
|
logger.debug 'Viewing fax outbox from cloud service'
|
129
123
|
postVariables = { action: 'Get_Fax_Outbox' }
|
130
124
|
res = execute(postVariables)
|
131
125
|
|
132
126
|
if res[:Status] != 'Failure'
|
133
|
-
faxcount = res['Result'].
|
127
|
+
faxcount = res['Result'].length
|
134
128
|
faxcount > 0 ? logger.debug("Found #{faxcount} new fax(es)") : logger.debug('No faxes found matching that criteria')
|
135
129
|
end
|
136
130
|
|
data/lib/srfax/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: srfax
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Klink
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-07-
|
13
|
+
date: 2016-07-28 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: minitest
|