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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7361e07644b404b7797ed86aa2565c19263e26e3
4
- data.tar.gz: 0e73c2a890458e6e8ce11569e3f550c7a301b1a1
3
+ metadata.gz: 51568433d207d77f782eccfb5772bacd256652b0
4
+ data.tar.gz: d046079794eee89f4a974b5cb98984f5ebf79509
5
5
  SHA512:
6
- metadata.gz: 0dd2c90bbc8f04d39254fea1df0d5fda081bc1672a4c609a3edbeb75e975c6c679c7e036029be20fbdff086793f78684efc150ae6e5e9cf3c4c76124fb404290
7
- data.tar.gz: 8303cdba71805cfe4c80d6a1e606eb6a9c31f8e1a06e4cc2096553911c77e7f92a0a267b448d4dce1a31ee2aad5f1497baa64e79e25fbc8f72c025aff4dc1991
6
+ metadata.gz: 286efbdb570c8591d99cb1821e74ffd06d67ea31e0730e5a5d1d3a68d2eb97af0b431ad034bb4a5dadec8a01c8b6fe4813e72c848d6871f6e7fce548cd18b675
7
+ data.tar.gz: 97ea272301d677c89e36556d4d04ce675a28881d9676f1035e9677a57a345ee55f3e3849b0ce415e7a6481c1e26895319e0b5faec0e141f0f12f3669ead3dc89
@@ -1,5 +1,5 @@
1
1
  module Megam
2
2
  class API
3
- VERSION = "0.38"
3
+ VERSION = "0.39"
4
4
  end
5
5
  end
@@ -76,71 +76,68 @@ end
76
76
  index_hash
77
77
  end
78
78
 
79
- def to_json(*a)
80
- for_json.to_json(*a)
81
- end
79
+ def to_json(*a)
80
+ for_json.to_json(*a)
81
+ end
82
82
 
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
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
- 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
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
- org = self.new(o[:email], o[:api_key])
105
- org.from_hash(o)
106
- org
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
- @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
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
- org = from_hash(o)
119
- org.create
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(email,api_key=nil)
124
- org = self.new(email, api_key)
125
- org.megam_rest.get_organizations(email)
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
- def self.list(tmp_email=nil, tmp_api_key=nil)
129
- org = self.new(tmp_email,tmp_api_key)
128
+ def self.list(o)
129
+ org = from_hash(o)
130
130
  org.megam_rest.get_organizations
131
- end
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.38'
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-27 00:00:00.000000000 Z
11
+ date: 2015-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: excon