freshmail 0.1.5 → 0.1.6
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 +4 -4
- data/lib/freshmail/client.rb +10 -6
- data/lib/freshmail/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: 14e23a4b6337b39a26b7b336d0cba51fc002161c
|
4
|
+
data.tar.gz: dbb716e21359a6f19abfae680ccf94d2a625f0cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 241c0829dcfe4738f45c33c75f25f7f499da0dad7cfe67d61616e8f29171bb5b37b2c98262367148cf247f739d83b19933aeb5be24de7480da11ceafc6e0aefa
|
7
|
+
data.tar.gz: 3a3e312e8b52553be3c17fae72afda9fe894caa79ec61332ee1b4451835bb8446a1234d24332b5ce6d3a6f4eb00d2f22a3b3924ad86ee8fdfda711a622437d22
|
data/lib/freshmail/client.rb
CHANGED
@@ -25,7 +25,7 @@ module Freshmail
|
|
25
25
|
def subscriber(sub_info = {})
|
26
26
|
list = sub_info[:list]
|
27
27
|
email = sub_info[:email]
|
28
|
-
|
28
|
+
|
29
29
|
call_freshmail(:get, "subscriber/get/#{list}/#{email}")
|
30
30
|
end
|
31
31
|
|
@@ -37,6 +37,10 @@ module Freshmail
|
|
37
37
|
call_freshmail(:post, 'subscriber/add', sub_info)
|
38
38
|
end
|
39
39
|
|
40
|
+
def edit_subscriber(sub_info = {})
|
41
|
+
call_freshmail(:post, 'subscriber/edit', sub_info)
|
42
|
+
end
|
43
|
+
|
40
44
|
def batch_add_subscriber(sub_info = {})
|
41
45
|
call_freshmail(:post, 'subscriber/addMultiple', sub_info)
|
42
46
|
end
|
@@ -67,13 +71,13 @@ module Freshmail
|
|
67
71
|
|
68
72
|
protected
|
69
73
|
def call_freshmail(call_type, get_data, json_data = nil)
|
70
|
-
json_data_converted = json_data ? json_data.to_json : ''
|
74
|
+
json_data_converted = json_data ? json_data.to_json : ''
|
71
75
|
endpoint = "/rest/#{get_data}"
|
72
76
|
|
73
77
|
conn = Faraday.new(:url => URL) do |faraday|
|
74
|
-
faraday.request :url_encoded
|
75
|
-
# faraday.response :logger
|
76
|
-
faraday.adapter Faraday.default_adapter
|
78
|
+
faraday.request :url_encoded
|
79
|
+
# faraday.response :logger
|
80
|
+
faraday.adapter Faraday.default_adapter
|
77
81
|
end
|
78
82
|
|
79
83
|
response = conn.send(call_type) do |req|
|
@@ -96,4 +100,4 @@ module Freshmail
|
|
96
100
|
].join
|
97
101
|
end
|
98
102
|
end
|
99
|
-
end
|
103
|
+
end
|
data/lib/freshmail/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: freshmail
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcin Jan Adamczyk
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-03-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|