megam_api 0.38 → 0.39
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/organizations.rb +50 -53
- 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: 51568433d207d77f782eccfb5772bacd256652b0
|
4
|
+
data.tar.gz: d046079794eee89f4a974b5cb98984f5ebf79509
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 286efbdb570c8591d99cb1821e74ffd06d67ea31e0730e5a5d1d3a68d2eb97af0b431ad034bb4a5dadec8a01c8b6fe4813e72c848d6871f6e7fce548cd18b675
|
7
|
+
data.tar.gz: 97ea272301d677c89e36556d4d04ce675a28881d9676f1035e9677a57a345ee55f3e3849b0ce415e7a6481c1e26895319e0b5faec0e141f0f12f3669ead3dc89
|
data/lib/megam/api/version.rb
CHANGED
@@ -76,71 +76,68 @@ end
|
|
76
76
|
index_hash
|
77
77
|
end
|
78
78
|
|
79
|
-
def to_json(*a)
|
80
|
-
|
81
|
-
end
|
79
|
+
def to_json(*a)
|
80
|
+
for_json.to_json(*a)
|
81
|
+
end
|
82
82
|
|
83
|
-
def for_json
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
end
|
83
|
+
def for_json
|
84
|
+
result = {
|
85
|
+
"id" => id,
|
86
|
+
"name" => name,
|
87
|
+
"accounts_id" => accounts_id,
|
88
|
+
"created_at" => created_at
|
89
|
+
}
|
90
|
+
result
|
91
|
+
end
|
92
92
|
|
93
|
-
# Create a Megam::Organization from JSON (used by the backgroud job workers)
|
94
|
-
def self.json_create(o)
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
end
|
93
|
+
# Create a Megam::Organization from JSON (used by the backgroud job workers)
|
94
|
+
def self.json_create(o)
|
95
|
+
org = new
|
96
|
+
org.id(o["id"]) if o.has_key?("id")
|
97
|
+
org.name(o["name"]) if o.has_key?("name")
|
98
|
+
org.accounts_id(o["accounts_id"]) if o.has_key?("accounts_id")
|
99
|
+
org.created_at(o["created_at"]) if o.has_key?("created_at")
|
100
|
+
org
|
101
|
+
end
|
102
102
|
|
103
|
-
def self.from_hash(o)
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
end
|
103
|
+
def self.from_hash(o)
|
104
|
+
org = self.new(o[:email], o[:api_key])
|
105
|
+
org.from_hash(o)
|
106
|
+
org
|
107
|
+
end
|
108
108
|
|
109
|
-
def from_hash(o)
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
end
|
109
|
+
def from_hash(o)
|
110
|
+
@id = o[:id] if o.has_key?(:id)
|
111
|
+
@name = o[:name] if o.has_key?(:name)
|
112
|
+
@accounts_id = o[:accounts_id] if o.has_key?(:accounts_id)
|
113
|
+
@created_at = o[:created_at] if o.has_key?(:created_at)
|
114
|
+
self
|
115
|
+
end
|
116
116
|
|
117
|
-
def self.create(o)
|
118
|
-
|
119
|
-
|
120
|
-
end
|
117
|
+
def self.create(o)
|
118
|
+
org = from_hash(o)
|
119
|
+
org.create
|
120
|
+
end
|
121
121
|
|
122
|
-
# Load a organization by email_p
|
123
|
-
def self.show(
|
124
|
-
|
125
|
-
|
126
|
-
end
|
122
|
+
# Load a organization by email_p
|
123
|
+
def self.show(o)
|
124
|
+
org = from_hash(o)
|
125
|
+
org.megam_rest.get_organizations(email)
|
126
|
+
end
|
127
127
|
|
128
|
-
|
129
|
-
|
128
|
+
def self.list(o)
|
129
|
+
org = from_hash(o)
|
130
130
|
org.megam_rest.get_organizations
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
def create
|
131
|
+
end
|
132
|
+
|
133
|
+
|
134
|
+
def create
|
136
135
|
megam_rest.post_organizations(to_hash)
|
137
|
-
end
|
136
|
+
end
|
138
137
|
|
139
|
-
def to_s
|
138
|
+
def to_s
|
140
139
|
Megam::Stuff.styled_hash(to_hash)
|
141
140
|
end
|
142
141
|
|
143
|
-
|
144
142
|
end
|
145
|
-
|
146
143
|
end
|
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.39'
|
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-04-
|
11
|
+
date: 2015-04-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: excon
|