megam_api 1.8.6 → 1.8.7
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/megam/api/license.rb +1 -1
- data/lib/megam/api/version.rb +1 -1
- data/lib/megam/core/json_compat.rb +2 -0
- data/lib/megam/core/license.rb +8 -58
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02d2482daec0b4dd2d4fb4f323503eca81085dcf
|
4
|
+
data.tar.gz: 7c8c06d82820074532de54b9282b8f93d6ed52a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f353a3add0bf9411c5ecb34c225914629ac1710eef02498af85e4b821decd50ecc06d6002982c219b9de99dfa9d2527ebb18e25fe7d0184e64efdb8f8ce1fe8
|
7
|
+
data.tar.gz: 156f6666cc9d27e6c7add544eaf83259c249e68d8560ffce7d58d50dfe45afff49c92110e5eb37acd2ee3a942a0ad92970c1668260e1c33bea7025fbf7dd9479
|
data/lib/megam/api/license.rb
CHANGED
data/lib/megam/api/version.rb
CHANGED
data/lib/megam/core/license.rb
CHANGED
@@ -1,12 +1,8 @@
|
|
1
1
|
module Megam
|
2
2
|
class License < Megam::RestAdapter
|
3
3
|
def initialize(o)
|
4
|
-
@id = nil
|
5
|
-
@name = nil
|
6
4
|
@org_id = nil
|
7
|
-
@
|
8
|
-
@publickey=nil
|
9
|
-
@created_at = nil
|
5
|
+
@data = nil
|
10
6
|
@some_msg = {}
|
11
7
|
super(o)
|
12
8
|
end
|
@@ -15,22 +11,6 @@ module Megam
|
|
15
11
|
self
|
16
12
|
end
|
17
13
|
|
18
|
-
def id(arg=nil)
|
19
|
-
if arg != nil
|
20
|
-
@id = arg
|
21
|
-
else
|
22
|
-
@id
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
def name(arg=nil)
|
27
|
-
if arg != nil
|
28
|
-
@name = arg
|
29
|
-
else
|
30
|
-
@name
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
14
|
def org_id(arg=nil)
|
35
15
|
if arg != nil
|
36
16
|
@org_id= arg
|
@@ -39,28 +19,14 @@ module Megam
|
|
39
19
|
end
|
40
20
|
end
|
41
21
|
|
42
|
-
def privatekey(arg=nil)
|
43
|
-
if arg != nil
|
44
|
-
@privatekey = arg
|
45
|
-
else
|
46
|
-
@privatekey
|
47
|
-
end
|
48
|
-
end
|
49
22
|
|
50
|
-
def publickey(arg=nil)
|
51
|
-
if arg != nil
|
52
|
-
@publickey = arg
|
53
|
-
else
|
54
|
-
@publickey
|
55
|
-
end
|
56
|
-
end
|
57
23
|
|
58
24
|
|
59
|
-
def
|
25
|
+
def data(arg=nil)
|
60
26
|
if arg != nil
|
61
|
-
@
|
27
|
+
@data = arg
|
62
28
|
else
|
63
|
-
@
|
29
|
+
@data
|
64
30
|
end
|
65
31
|
end
|
66
32
|
|
@@ -80,12 +46,8 @@ module Megam
|
|
80
46
|
def to_hash
|
81
47
|
index_hash = Hash.new
|
82
48
|
index_hash["json_claz"] = self.class.name
|
83
|
-
index_hash["id"] = id
|
84
|
-
index_hash["name"] = name
|
85
49
|
index_hash["org_id"] = org_id
|
86
|
-
index_hash["
|
87
|
-
index_hash["publickey"] = publickey
|
88
|
-
index_hash["created_at"] = created_at
|
50
|
+
index_hash["data"] = data
|
89
51
|
index_hash
|
90
52
|
end
|
91
53
|
|
@@ -97,12 +59,8 @@ module Megam
|
|
97
59
|
|
98
60
|
def for_json
|
99
61
|
result = {
|
100
|
-
"id" => id,
|
101
|
-
"name" => name,
|
102
62
|
"org_id" => org_id,
|
103
|
-
"
|
104
|
-
"publickey" => publickey,
|
105
|
-
"created_at" => created_at
|
63
|
+
"data" => data
|
106
64
|
}
|
107
65
|
result
|
108
66
|
end
|
@@ -110,11 +68,7 @@ module Megam
|
|
110
68
|
#
|
111
69
|
def self.json_create(o)
|
112
70
|
license = new({})
|
113
|
-
license.
|
114
|
-
license.name(o["name"]) if o.has_key?("name")
|
115
|
-
license.privatekey(o["privatekey"]) if o.has_key?("privatekey")
|
116
|
-
license.publickey(o["publickey"]) if o.has_key?("publickey")
|
117
|
-
license.created_at(o["created_at"]) if o.has_key?("created_at")
|
71
|
+
license.created_at(o["data"]) if o.has_key?("data")
|
118
72
|
#success or error
|
119
73
|
license.some_msg[:code] = o["code"] if o.has_key?("code")
|
120
74
|
license.some_msg[:msg_type] = o["msg_type"] if o.has_key?("msg_type")
|
@@ -130,12 +84,8 @@ module Megam
|
|
130
84
|
end
|
131
85
|
|
132
86
|
def from_hash(o)
|
133
|
-
@id = o[:id] if o.has_key?(:id)
|
134
|
-
@name = o[:name] if o.has_key?(:name)
|
135
87
|
@org_id = o[:org_id] if o.has_key?(:org_id)
|
136
|
-
@
|
137
|
-
@publickey = o[:publickey] if o.has_key?(:publickey)
|
138
|
-
@created_at = o[:created_at] if o.has_key?(:created_at)
|
88
|
+
@data = o[:data] if o.has_key?(:data)
|
139
89
|
self
|
140
90
|
end
|
141
91
|
|