nifty-email 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/nifty-email.rb +8 -1
- data/lib/nifty-email/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: 39588305aa311a21238a6ec36b77c7c4adf1aa30
|
4
|
+
data.tar.gz: c2e621511aa880dd8f5e19b1d41bbf6850f8e662
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0bf53d147b5b08ac90b8d1fe3f0613b645612b26e740c2e011754bab95e2c2ed28da11fb72405de791d4f1d2198fb58426f9abeacedaeada70d9a943ad5eef2
|
7
|
+
data.tar.gz: 0f213501dfe87ec26265b25ec5755a22082e846ddc07aa2f8de324cd4968142760394b6d68651d3e8c2865c0cd5a77bc159ed158b09dad124c0011923d8f0a6e
|
data/lib/nifty-email.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
require 'json'
|
2
2
|
|
3
3
|
class NiftyEmail
|
4
|
+
class NiftyEmailError < StandardError; end
|
5
|
+
|
4
6
|
def self.token=(token)
|
5
7
|
@token = token
|
6
8
|
end
|
@@ -14,7 +16,12 @@ class NiftyEmail
|
|
14
16
|
connection.authorization('Token', token: @token)
|
15
17
|
|
16
18
|
response = connection.get("#{slug_or_id}.json", placeholders)
|
17
|
-
|
19
|
+
|
20
|
+
if response.status == 200
|
21
|
+
NiftyEmail::Email.new(JSON.parse(response.body))
|
22
|
+
else
|
23
|
+
raise NiftyEmailError, response.body
|
24
|
+
end
|
18
25
|
end
|
19
26
|
|
20
27
|
class Email
|
data/lib/nifty-email/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nifty-email
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Albertson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|