motion_yak 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/motion_yak/config.rb +4 -0
- data/lib/motion_yak/request.rb +3 -3
- data/lib/motion_yak/version.rb +1 -1
- data/lib/motion_yak.rb +29 -3
- metadata +3 -3
data/Gemfile.lock
CHANGED
data/lib/motion_yak/config.rb
CHANGED
data/lib/motion_yak/request.rb
CHANGED
@@ -6,19 +6,19 @@ module MotionYak
|
|
6
6
|
block.call(json)
|
7
7
|
end
|
8
8
|
end
|
9
|
-
def self.put(url, params)
|
9
|
+
def self.put(url, params, &block)
|
10
10
|
BW::HTTP.put(url, {payload: params}) do |response|
|
11
11
|
json = BW::JSON.parse(response.body.to_str)
|
12
12
|
block.call(json)
|
13
13
|
end
|
14
14
|
end
|
15
|
-
def self.post(url, params)
|
15
|
+
def self.post(url, params, &block)
|
16
16
|
BW::HTTP.post(url, {payload: params}) do |response|
|
17
17
|
json = BW::JSON.parse(response.body.to_str)
|
18
18
|
block.call(json)
|
19
19
|
end
|
20
20
|
end
|
21
|
-
def self.delete(url, params)
|
21
|
+
def self.delete(url, params, &block)
|
22
22
|
BW::HTTP.delete(url) do |response|
|
23
23
|
json = BW::JSON.parse(response.body.to_str)
|
24
24
|
block.call(json)
|
data/lib/motion_yak/version.rb
CHANGED
data/lib/motion_yak.rb
CHANGED
@@ -29,10 +29,36 @@ module MotionYak
|
|
29
29
|
[self.base_url, MotionYak.key, 'json', url].join('/')
|
30
30
|
end
|
31
31
|
|
32
|
-
def self.new_domain(domain)
|
33
|
-
params = {'Domain' => domain, 'CallbackURL' => MotionYak::Config.callback, 'PushEmail' => MotionYak::Config.
|
32
|
+
def self.new_domain(domain, &block)
|
33
|
+
params = {'Domain' => domain, 'CallbackURL' => MotionYak::Config.callback, 'PushEmail' => MotionYak::Config.push_params}
|
34
34
|
MotionYak::Request.post self.api_url('register/domain/'), params do |json|
|
35
|
-
|
35
|
+
block.call(json)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def self.new_address(address, &block)
|
40
|
+
params = {'Address' => address, 'CallbackURL' => MotionYak::Config.callback, 'PushEmail' => MotionYak::Config.push_params}
|
41
|
+
MotionYak::Request.post self.api_url('register/address/'), params do |json|
|
42
|
+
block.call(json)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def self.send_email(options, &block)
|
47
|
+
params = {}
|
48
|
+
params['FromAddress'] = options[:from]
|
49
|
+
params['FromName'] = options[:from_name]
|
50
|
+
params['SenderAddress'] = options[:sender_address]
|
51
|
+
params['ToAddress'] = options[:to]
|
52
|
+
params['ReplyToAddress'] = options[:reply_address]
|
53
|
+
params['CcAddress'] = options[:cc]
|
54
|
+
params['BccAddress'] = options[:bcc]
|
55
|
+
params['Subject'] = options[:subject]
|
56
|
+
params['HtmlBody'] = options[:html]
|
57
|
+
params['TextBody'] = options[:text]
|
58
|
+
params['Headers'] = options[:headers]
|
59
|
+
params['Attachments'] = options[:attachments]
|
60
|
+
MotionYak::Request.post self.api_url('send/email/'), params do |json|
|
61
|
+
block.call(json)
|
36
62
|
end
|
37
63
|
end
|
38
64
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: motion_yak
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -66,7 +66,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
66
66
|
version: '0'
|
67
67
|
segments:
|
68
68
|
- 0
|
69
|
-
hash:
|
69
|
+
hash: 3681157174053445989
|
70
70
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
71
71
|
none: false
|
72
72
|
requirements:
|
@@ -75,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
75
75
|
version: '0'
|
76
76
|
segments:
|
77
77
|
- 0
|
78
|
-
hash:
|
78
|
+
hash: 3681157174053445989
|
79
79
|
requirements: []
|
80
80
|
rubyforge_project:
|
81
81
|
rubygems_version: 1.8.21
|