innologix 0.0.10 → 0.0.11

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5b8b8383dc0fc2dcfaca5ae025396b2ccb01286a
4
- data.tar.gz: 4a98b992bb50d8e28968d48fd54736708cc06f6b
3
+ metadata.gz: d7e5f0d5a63cca96b05ff3a5ffb507bc9382aa85
4
+ data.tar.gz: 0de87192287961b769e2a709b4d556137e1ea609
5
5
  SHA512:
6
- metadata.gz: 27c015494c12c2fbf188129f017e23b1574656802ef300f63c9f1f364a4260c9e112a12c3126c583bf8005c850516b50c5b053946c7bf6e936e8b124115eedee
7
- data.tar.gz: 034ab4c53173c69dfce74080c86cd6c5852fe369777c2b69046d45c5a7f8c06a903718fb6427f7bdc86aca6badb4189bce35f4a8d7a0b69800f1255861d9c9a8
6
+ metadata.gz: c568803e05b6c0eb9e5c4cb7799a4bb1e959b1251f9846402c73ba351a8411b6231729e0c78c7c2929d18b0669b56f215ffba391a1e3ab7da9cdc303b4e8b240
7
+ data.tar.gz: d9a36a88aceeb8a39426ff0b39e104deda59e6f1f26dc9ad66112460c82f7f990e3841ecaca42ace141056034d5e5d2338514952629ce27c1406f7581750bee5
data/lib/innologix/m2m.rb CHANGED
@@ -9,7 +9,6 @@ module Innologix
9
9
  attr_accessor :updated_at
10
10
 
11
11
  attr_accessor :group
12
- attr_accessor :devices
13
12
 
14
13
  attr_accessor :client
15
14
  attr_accessor :error
@@ -155,13 +154,23 @@ module Innologix
155
154
  if attributes[:group] != nil
156
155
  m2m.group = Innologix::Group.new(attributes[:group])
157
156
  end
158
- m2m.devices = []
159
- if attributes[:devices] != nil
160
- attributes[:devices].each do |device|
161
- m2m.devices.push(Innologix::Device.new(device))
157
+ m2m
158
+ end
159
+
160
+ def devices(offset = 0, limit = 10)
161
+ path = '/devices'
162
+ method = 'get'
163
+ options = {query_params: {m2m_id: self.id, offset: offset, limit: limit}}
164
+ result = client.call_api(path, method, options)
165
+ if result[:error].nil?
166
+ list =[]
167
+ result[:devices].each do |device|
168
+ list.push(Innologix::Device.new(device))
162
169
  end
170
+ list
171
+ else
172
+ RequestError.new(result)
163
173
  end
164
- m2m
165
174
  end
166
175
  end
167
176
  end
@@ -1,3 +1,3 @@
1
1
  module Innologix
2
- VERSION = "0.0.10"
2
+ VERSION = "0.0.11"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: innologix
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - SkyLab Innogram