megam_api 0.53 → 0.54
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/version.rb +1 -1
- data/lib/megam/core/cat_request.rb +13 -14
- 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: 7435f480f5d49dde14ded28222afe0f7f9984751
|
4
|
+
data.tar.gz: d1df8ac5372aa37af59abe346dbbb54aced78364
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9249e35e3bea0541d685fe094f5acdd7aed97204e55855dffc9dad6dd58f7b7692464f9d7e107e5a857f370a91a7eb357f46da20cefd96a52cfbe4fbcffef523
|
7
|
+
data.tar.gz: da0b9a8828730fc6cc6190c0c0496870582ec007014f12a2e7deccc10c5e899fbf873f03240e4930c07639e4d0a26e9c37e45a9bf521be578ce73a27219fc158
|
data/lib/megam/api/version.rb
CHANGED
@@ -29,7 +29,7 @@ module Megam
|
|
29
29
|
self
|
30
30
|
end
|
31
31
|
|
32
|
-
|
32
|
+
|
33
33
|
def id(arg=nil)
|
34
34
|
if arg != nil
|
35
35
|
@id = arg
|
@@ -45,7 +45,7 @@ module Megam
|
|
45
45
|
@app_id
|
46
46
|
end
|
47
47
|
end
|
48
|
-
|
48
|
+
|
49
49
|
def app_name(arg=nil)
|
50
50
|
if arg != nil
|
51
51
|
@app_name = arg
|
@@ -61,8 +61,8 @@ module Megam
|
|
61
61
|
@action
|
62
62
|
end
|
63
63
|
end
|
64
|
-
|
65
|
-
|
64
|
+
|
65
|
+
|
66
66
|
def created_at(arg=nil)
|
67
67
|
if arg != nil
|
68
68
|
@created_at = arg
|
@@ -90,7 +90,7 @@ module Megam
|
|
90
90
|
index_hash["id"] = id
|
91
91
|
index_hash["app_id"] = app_id
|
92
92
|
index_hash["app_name"] = app_name
|
93
|
-
index_hash["action"] = action
|
93
|
+
index_hash["action"] = action
|
94
94
|
index_hash["created_at"] = created_at
|
95
95
|
index_hash
|
96
96
|
end
|
@@ -106,7 +106,7 @@ module Megam
|
|
106
106
|
"id" => id,
|
107
107
|
"app_id" => app_id,
|
108
108
|
"app_name" => app_name,
|
109
|
-
"action" => action,
|
109
|
+
"action" => action,
|
110
110
|
"created_at" => created_at
|
111
111
|
}
|
112
112
|
result
|
@@ -118,7 +118,7 @@ module Megam
|
|
118
118
|
node.id(o["id"]) if o.has_key?("id")
|
119
119
|
node.app_id(o["app_id"]) if o.has_key?("app_id")
|
120
120
|
node.app_name(o["app_name"]) if o.has_key?("app_name")
|
121
|
-
node.action(o["action"]) if o.has_key?("action")
|
121
|
+
node.action(o["action"]) if o.has_key?("action")
|
122
122
|
node.created_at(o["created_at"]) if o.has_key?("created_at")
|
123
123
|
#success or error
|
124
124
|
node.some_msg[:code] = o["code"] if o.has_key?("code")
|
@@ -134,30 +134,29 @@ module Megam
|
|
134
134
|
node
|
135
135
|
end
|
136
136
|
|
137
|
-
def from_hash(o)
|
137
|
+
def from_hash(o)
|
138
138
|
@id = o[:id] if o.has_key?(:id)
|
139
139
|
@app_id = o[:app_id] if o.has_key?(:app_id)
|
140
140
|
@app_name = o[:app_name] if o.has_key?(:app_name)
|
141
|
-
@action = o[:action] if o.has_key?(:action)
|
142
|
-
@created_at = o[:created_at] if o.has_key?(:created_at)
|
141
|
+
@action = o[:action] if o.has_key?(:action)
|
142
|
+
@created_at = o[:created_at] if o.has_key?(:created_at)
|
143
143
|
self
|
144
144
|
end
|
145
145
|
|
146
146
|
|
147
|
-
def self.create(o
|
148
|
-
acct = from_hash(o,
|
147
|
+
def self.create(o)
|
148
|
+
acct = from_hash(o, o["email"], o["api_key"])
|
149
149
|
acct.create
|
150
150
|
end
|
151
151
|
|
152
152
|
# Create the node via the REST API
|
153
153
|
def create
|
154
154
|
megam_rest.post_catrequest(to_hash)
|
155
|
-
end
|
155
|
+
end
|
156
156
|
|
157
157
|
|
158
158
|
def to_s
|
159
159
|
Megam::Stuff.styled_hash(to_hash)
|
160
|
-
#"---> Megam::Account:[error=#{error?}]\n"+
|
161
160
|
end
|
162
161
|
|
163
162
|
end
|