megam_api 0.49 → 0.50
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/megam/api/version.rb +1 -1
- data/lib/megam/core/account.rb +14 -1
- data/lib/megam/core/components.rb +3 -3
- data/test/test_accounts.rb +7 -4
- 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: 51c339062804a782ad14e595582a554ecb3f398f
|
4
|
+
data.tar.gz: 38393e4e2c176d350be447aee3761565daff91e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13faebc30d1a03835b4e903dd1bd851a585341c45f654c31cb28a1a2fc01d36b508c9729ede599a680b01be31b41d2608a403b791c18e09efb35fa7a2ebbd26f
|
7
|
+
data.tar.gz: d4787ace7c526136bff0ff11f10674e95c1854e0dcfaae4db79d44564df5591a587001eb4e60f3bd37ee99dd7fa57940a48a832be9eb5fa542f44349b7604e22
|
data/lib/megam/api/version.rb
CHANGED
data/lib/megam/core/account.rb
CHANGED
@@ -25,6 +25,7 @@ module Megam
|
|
25
25
|
@password = nil
|
26
26
|
@authority = nil
|
27
27
|
@password_reset_key = nil
|
28
|
+
@password_reset_sent_at = nil
|
28
29
|
@created_at = nil
|
29
30
|
@some_msg = {}
|
30
31
|
super(email, api_key)
|
@@ -107,6 +108,15 @@ module Megam
|
|
107
108
|
end
|
108
109
|
end
|
109
110
|
|
111
|
+
def password_reset_sent_at(arg=nil)
|
112
|
+
if arg != nil
|
113
|
+
@password_reset_sent_at = arg
|
114
|
+
else
|
115
|
+
@password_reset_sent_at
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
|
110
120
|
def created_at(arg=nil)
|
111
121
|
if arg != nil
|
112
122
|
@created_at = arg
|
@@ -139,6 +149,7 @@ module Megam
|
|
139
149
|
index_hash["phone"] = phone
|
140
150
|
index_hash["password"] = password
|
141
151
|
index_hash["password_reset_key"] = password_reset_key
|
152
|
+
index_hash["password_reset_sent_at"] = password_reset_sent_at
|
142
153
|
index_hash["authority"] = authority
|
143
154
|
index_hash["created_at"] = created_at
|
144
155
|
index_hash["some_msg"] = some_msg
|
@@ -161,6 +172,7 @@ module Megam
|
|
161
172
|
"phone" => phone,
|
162
173
|
"password" => password,
|
163
174
|
"password_reset_key" => password_reset_key,
|
175
|
+
"password_reset_sent_at" => password_reset_sent_at,
|
164
176
|
"authority" => authority,
|
165
177
|
"created_at" => created_at
|
166
178
|
}
|
@@ -179,6 +191,7 @@ module Megam
|
|
179
191
|
acct.phone(o["phone"]) if o.has_key?("phone")
|
180
192
|
acct.password(o["password"]) if o.has_key?("password")
|
181
193
|
acct.password_reset_key(o["password_reset_key"]) if o.has_key?("password_reset_key")
|
194
|
+
acct.password_reset_key(o["password_reset_sent_at"]) if o.has_key?("password_reset_sent_at")
|
182
195
|
acct.created_at(o["created_at"]) if o.has_key?("created_at")
|
183
196
|
acct.some_msg[:code] = o["code"] if o.has_key?("code")
|
184
197
|
acct.some_msg[:msg_type] = o["msg_type"] if o.has_key?("msg_type")
|
@@ -203,6 +216,7 @@ module Megam
|
|
203
216
|
@phone = o[:phone] if o.has_key?(:phone)
|
204
217
|
@password = o[:password] if o.has_key?(:password)
|
205
218
|
@password_reset_key = o[:password_reset_key] if o.has_key?(:password_reset_key)
|
219
|
+
@password_reset_sent_at = o[:password_reset_sent_at] if o.has_key?(:password_reset_sent_at)
|
206
220
|
@created_at = o[:created_at] if o.has_key?(:created_at)
|
207
221
|
self
|
208
222
|
end
|
@@ -226,7 +240,6 @@ module Megam
|
|
226
240
|
|
227
241
|
|
228
242
|
def self.update(o)
|
229
|
-
puts "called uda"
|
230
243
|
acct = from_hash(o)
|
231
244
|
acct.update
|
232
245
|
end
|
@@ -26,7 +26,7 @@ module Megam
|
|
26
26
|
@artifact_type = nil
|
27
27
|
@content = nil
|
28
28
|
@artifact_requirements = []
|
29
|
-
@related_components =
|
29
|
+
@related_components = []
|
30
30
|
@operations = []
|
31
31
|
@status = nil
|
32
32
|
@created_at = nil
|
@@ -110,8 +110,8 @@ module Megam
|
|
110
110
|
end
|
111
111
|
end
|
112
112
|
|
113
|
-
def related_components(arg=
|
114
|
-
if arg !=
|
113
|
+
def related_components(arg=[])
|
114
|
+
if arg != []
|
115
115
|
@related_components = arg
|
116
116
|
else
|
117
117
|
@related_components
|
data/test/test_accounts.rb
CHANGED
@@ -12,24 +12,27 @@ class TestAccounts < MiniTest::Unit::TestCase
|
|
12
12
|
response.body.to_s
|
13
13
|
assert_equal(200, response.status)
|
14
14
|
end
|
15
|
-
|
15
|
+
=end
|
16
16
|
def test_post_accounts_good
|
17
17
|
tmp_hash = {
|
18
18
|
"id" => "000099090909000",
|
19
19
|
"first_name" => "Darth",
|
20
20
|
"last_name" => "Vader",
|
21
|
-
"email" => "coolvader@
|
21
|
+
"email" => "coolvader@iamswag.com",
|
22
22
|
"phone" => "19090909090",
|
23
23
|
"api_key" => "IamAtlas{74}NobdyCanSedfefdeME#07",
|
24
24
|
"authority" => "admin",
|
25
|
+
"password" => "",
|
25
26
|
"password_reset_key" => "",
|
27
|
+
"password_reset_sent_at" => "",
|
26
28
|
"created_at" => "2014-10-29 13:24:06 +0000"
|
27
29
|
}
|
28
30
|
response =megams.post_accounts(tmp_hash)
|
29
31
|
response.body.to_s
|
30
32
|
assert_equal(201, response.status)
|
31
33
|
end
|
32
|
-
|
34
|
+
|
35
|
+
=begin
|
33
36
|
def test_update_accounts_good
|
34
37
|
tmp_hash = {
|
35
38
|
"id" => "w3423",
|
@@ -47,7 +50,7 @@ class TestAccounts < MiniTest::Unit::TestCase
|
|
47
50
|
response.body.to_s
|
48
51
|
assert_equal(201, response.status)
|
49
52
|
end
|
50
|
-
|
53
|
+
=end
|
51
54
|
=begin
|
52
55
|
def test_get_accounts_bad
|
53
56
|
assert_raises(Megam::API::Errors::NotFound) do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: megam_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.50'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rajthilak, Kishorekumar Neelamegam, Thomas Alrin, Yeshwanth Kumar, Subash Sethurajan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: excon
|