megam_api 1.5.beta4 → 1.5.beta5

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: f3b7e1ccc6b734fad35cc5d649f2802ba83392c2
4
- data.tar.gz: adf6d7ef48542c53b2f848df6ffe2ede953376a9
3
+ metadata.gz: 0edfa7aca1cb129ca26f22abe2ba83bfb66bfcca
4
+ data.tar.gz: 2bc809055aef36959b7074b352f11fa8d845e397
5
5
  SHA512:
6
- metadata.gz: 70d9e54d564fb7a3b47290cb6d477d41ad50194eace6f956cf2dc4bd919510dde5b54d36d31fcf86f1a61ae87690c967f7e6a68078bf79f78c921819c9bbbac6
7
- data.tar.gz: ec79766a10e0c980a50757a12c663636d5e53e50011c453bcfaa39385de5fa098ce1ad83bb2e94f380185ef53d7f987e8b3e877455230afd5cf552a25d56a9a3
6
+ metadata.gz: 57abf4e97ede9a0e9e0809b96b70f6cf42fc6660ba89d0815f2821b7823ee5a2695730582c9be0523349f9465e730bf3701e1705194e9ffe721a6d3b83c91ab4
7
+ data.tar.gz: 506a98809838c2b965762dc3df1f1eddcd8155de64b746ed826c992f1a51b31e8630299ffd2867bd644190971f1139e1b0b5fb6ab08a7f9046838f11d858ef66
@@ -15,6 +15,6 @@
15
15
  #
16
16
  module Megam
17
17
  class API
18
- VERSION = "1.5.beta4"
18
+ VERSION = "1.5.beta5"
19
19
  end
20
20
  end
@@ -15,177 +15,193 @@
15
15
  #
16
16
 
17
17
  module Megam
18
- class Assemblies < Megam::RestAdapter
19
- def initialize(o)
20
- @id = nil
21
- @accounts_id = nil
22
- @org_id = nil
23
- @name = nil
24
- @password = nil
25
- @assemblies = []
26
- @inputs = []
27
- @created_at = nil
28
- super(o)
29
- end
30
-
31
- def assemblies
32
- self
33
- end
34
-
35
- def id(arg=nil)
36
- if arg != nil
37
- @id = arg
38
- else
39
- @id
40
- end
41
- end
42
-
43
- def accounts_id(arg=nil)
44
- if arg != nil
45
- @accounts_id = arg
46
- else
47
- @accounts_id
48
- end
49
- end
50
-
51
- def org_id(arg=nil)
52
- if arg != nil
53
- @org_id = arg
54
- else
55
- @org_id
56
- end
57
- end
58
-
59
- def password(arg=nil)
60
- if arg != nil
61
- @password = arg
62
- else
63
- @password
64
- end
65
- end
66
-
67
- def name(arg=nil)
68
- if arg != nil
69
- @name = arg
70
- else
71
- @name
72
- end
73
- end
74
-
75
- def assemblies(arg=[])
76
- if arg != []
77
- @assemblies = arg
78
- else
79
- @assemblies
80
- end
81
- end
82
-
83
- def inputs(arg=[])
84
- if arg != []
85
- @inputs = arg
86
- else
87
- @inputs
88
- end
89
- end
90
-
91
- def created_at(arg=nil)
92
- if arg != nil
93
- @created_at = arg
94
- else
95
- @created_at
96
- end
97
- end
98
-
99
- def error?
100
- crocked = true if (some_msg.has_key?(:msg_type) && some_msg[:msg_type] == "error")
101
- end
18
+ class Assemblies < Megam::RestAdapter
19
+ def initialize(o)
20
+ @id = nil
21
+ @accounts_id = nil
22
+ @org_id = nil
23
+ @name = nil
24
+ @password = nil
25
+ @assemblies = []
26
+ @inputs = []
27
+ @created_at = nil
28
+ @some_msg = {}
29
+ super(o)
30
+ end
31
+
32
+ def assemblies
33
+ self
34
+ end
35
+
36
+ def id(arg=nil)
37
+ if arg != nil
38
+ @id = arg
39
+ else
40
+ @id
41
+ end
42
+ end
43
+
44
+ def accounts_id(arg=nil)
45
+ if arg != nil
46
+ @accounts_id = arg
47
+ else
48
+ @accounts_id
49
+ end
50
+ end
51
+
52
+ def org_id(arg=nil)
53
+ if arg != nil
54
+ @org_id = arg
55
+ else
56
+ @org_id
57
+ end
58
+ end
59
+
60
+ def password(arg=nil)
61
+ if arg != nil
62
+ @password = arg
63
+ else
64
+ @password
65
+ end
66
+ end
67
+
68
+ def name(arg=nil)
69
+ if arg != nil
70
+ @name = arg
71
+ else
72
+ @name
73
+ end
74
+ end
75
+
76
+ def assemblies(arg=[])
77
+ if arg != []
78
+ @assemblies = arg
79
+ else
80
+ @assemblies
81
+ end
82
+ end
83
+
84
+ def inputs(arg=[])
85
+ if arg != []
86
+ @inputs = arg
87
+ else
88
+ @inputs
89
+ end
90
+ end
91
+
92
+ def created_at(arg=nil)
93
+ if arg != nil
94
+ @created_at = arg
95
+ else
96
+ @created_at
97
+ end
98
+ end
99
+
100
+ def error?
101
+ crocked = true if (some_msg.has_key?(:msg_type) && some_msg[:msg_type] == "error")
102
+ end
103
+
104
+
105
+ def some_msg(arg=nil)
106
+ if arg != nil
107
+ @some_msg = arg
108
+ else
109
+ @some_msg
110
+ end
111
+ end
112
+
113
+
114
+ # Transform the ruby obj -> to a Hash
115
+ def to_hash
116
+ index_hash = Hash.new
117
+ index_hash["json_claz"] = self.class.name
118
+ index_hash["id"] = id
119
+ index_hash["org_id"] = org_id
120
+ index_hash["name"] = name
121
+ index_hash["accounts_id"] = accounts_id
122
+ index_hash["inputs"] = inputs
123
+ index_hash["assemblies"] = assemblies
124
+ index_hash["created_at"] = created_at
125
+ index_hash["some_msg"] = some_msg
126
+ index_hash
127
+ end
128
+
129
+ # Serialize this object as a hash: called from JsonCompat.
130
+ # Verify if this called from JsonCompat during testing.
131
+ def to_json(*a)
132
+ for_json.to_json(*a)
133
+ end
134
+
135
+ def for_json
136
+ result = {
137
+ "id" => id,
138
+ "name" => name,
139
+ "accounts_id" => accounts_id,
140
+ "org_id" => org_id,
141
+ "assemblies" => assemblies,
142
+ "inputs" => inputs,
143
+ "created_at" => created_at
144
+ }
145
+ result
146
+ end
147
+
148
+ def self.json_create(o)
149
+ asm = new({})
150
+ asm.id(o["id"]) if o.has_key?("id")
151
+ asm.name(o["name"]) if o.has_key?("name")
152
+ asm.accounts_id(o["accounts_id"]) if o.has_key?("accounts_id")
153
+ asm.org_id(o["org_id"]) if o.has_key?("org_id")
154
+ asm.assemblies(o["assemblies"]) if o.has_key?("assemblies") #this will be an array? can hash store array?
155
+ asm.inputs(o["inputs"]) if o.has_key?("inputs")
156
+ asm.created_at(o["created_at"]) if o.has_key?("created_at")
157
+ asm.some_msg[:code] = o["code"] if o.has_key?("code")
158
+ asm.some_msg[:msg_type] = o["msg_type"] if o.has_key?("msg_type")
159
+ asm.some_msg[:msg]= o["msg"] if o.has_key?("msg")
160
+ asm.some_msg[:links] = o["links"] if o.has_key?("links")
161
+ asm
162
+ end
163
+
164
+ def self.from_hash(o)
165
+ asm = self.new(o)
166
+ asm.from_hash(o)
167
+ asm
168
+ end
169
+
170
+ def from_hash(o)
171
+ @id = o[:id] if o.has_key?(:id)
172
+ @name = o[:name] if o.has_key?(:name)
173
+ @accounts_id = o[:accounts_id] if o.has_key?(:accounts_id)
174
+ @org_id = o[:org_id] if o.has_key?(:org_id)
175
+ @assemblies = o[:assemblies] if o.has_key?(:assemblies)
176
+ @inputs = o[:inputs] if o.has_key?(:inputs)
177
+ @created_at = o[:created_at] if o.has_key?(:created_at)
178
+ self
179
+ end
180
+
181
+ def self.create(params)
182
+ asm = from_hash(params)
183
+ asm.create
184
+ end
185
+
186
+ # Create the node via the REST API
187
+ def create
188
+ megam_rest.post_assemblies(to_hash)
189
+ end
190
+
191
+ # Load a account by email_p
192
+ def self.show(o)
193
+ asm = self.new(o)
194
+ asm.megam_rest.get_one_assemblies(o[:assemblies_id])
195
+ end
196
+
197
+ def self.list(params)
198
+ asm = self.new(params)
199
+ asm.megam_rest.get_assemblies
200
+ end
201
+
202
+ def to_s
203
+ Megam::Stuff.styled_hash(to_hash)
204
+ end
102
205
 
103
- # Transform the ruby obj -> to a Hash
104
- def to_hash
105
- index_hash = Hash.new
106
- index_hash["json_claz"] = self.class.name
107
- index_hash["id"] = id
108
- index_hash["org_id"] = org_id
109
- index_hash["name"] = name
110
- index_hash["accounts_id"] = accounts_id
111
- index_hash["inputs"] = inputs
112
- index_hash["assemblies"] = assemblies
113
- index_hash["created_at"] = created_at
114
- index_hash
115
206
  end
116
-
117
- # Serialize this object as a hash: called from JsonCompat.
118
- # Verify if this called from JsonCompat during testing.
119
- def to_json(*a)
120
- for_json.to_json(*a)
121
- end
122
-
123
- def for_json
124
- result = {
125
- "id" => id,
126
- "name" => name,
127
- "accounts_id" => accounts_id,
128
- "org_id" => org_id,
129
- "assemblies" => assemblies,
130
- "inputs" => inputs,
131
- "created_at" => created_at
132
- }
133
- result
134
- end
135
-
136
- def self.json_create(o)
137
- asm = new({})
138
- asm.id(o["id"]) if o.has_key?("id")
139
- asm.name(o["name"]) if o.has_key?("name")
140
- asm.accounts_id(o["accounts_id"]) if o.has_key?("accounts_id")
141
- asm.org_id(o["org_id"]) if o.has_key?("org_id")
142
- asm.assemblies(o["assemblies"]) if o.has_key?("assemblies") #this will be an array? can hash store array?
143
- asm.inputs(o["inputs"]) if o.has_key?("inputs")
144
- asm.created_at(o["created_at"]) if o.has_key?("created_at")
145
- asm
146
- end
147
-
148
- def self.from_hash(o)
149
- asm = self.new(o)
150
- asm.from_hash(o)
151
- asm
152
- end
153
-
154
- def from_hash(o)
155
- @id = o[:id] if o.has_key?(:id)
156
- @name = o[:name] if o.has_key?(:name)
157
- @accounts_id = o[:accounts_id] if o.has_key?(:accounts_id)
158
- @org_id = o[:org_id] if o.has_key?(:org_id)
159
- @assemblies = o[:assemblies] if o.has_key?(:assemblies)
160
- @inputs = o[:inputs] if o.has_key?(:inputs)
161
- @created_at = o[:created_at] if o.has_key?(:created_at)
162
- self
163
- end
164
-
165
- def self.create(params)
166
- asm = from_hash(params)
167
- asm.create
168
- end
169
-
170
- # Create the node via the REST API
171
- def create
172
- megam_rest.post_assemblies(to_hash)
173
- end
174
-
175
- # Load a account by email_p
176
- def self.show(o)
177
- asm = self.new(o)
178
- asm.megam_rest.get_one_assemblies(o[:assemblies_id])
179
- end
180
-
181
- def self.list(params)
182
- asm = self.new(params)
183
- asm.megam_rest.get_assemblies
184
- end
185
-
186
- def to_s
187
- Megam::Stuff.styled_hash(to_hash)
188
- end
189
-
190
- end
191
207
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: megam_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.beta4
4
+ version: 1.5.beta5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rajthilak, Kishorekumar Neelamegam, Thomas Alrin, Yeshwanth Kumar, Subash Sethurajan,
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-06-06 00:00:00.000000000 Z
12
+ date: 2016-06-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: excon