m2x 2.0.2 → 2.1.0
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/m2x/device.rb +6 -6
- data/lib/m2x/resource.rb +6 -0
- data/lib/m2x/stream.rb +1 -1
- data/lib/m2x/version.rb +1 -1
- 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: 9affc8594c00bbcb4dd5b570afdc9deacb6ae493
|
4
|
+
data.tar.gz: 204e7043534ee6b80c32475f5200ae4e9db6f87c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53641a6fad6d8ae91d37cdbee0fadf02efe4082391e29f82252415378dfa4ce9514a29a1614a2f635ce1faf86a6409f46f12cc454b77b71bc2f08bb1b61110b3
|
7
|
+
data.tar.gz: 1e77ac43920349303a243cda56c7e707c447a5fe0a75163223ed6e847ec26eddad4c556aa8b83cb3a5fcf9f4d29463c6ec4ab35cac10221bfe19c6948cff2c67
|
data/lib/m2x/device.rb
CHANGED
@@ -29,12 +29,12 @@ class M2X::Client::Device < M2X::Client::Resource
|
|
29
29
|
res.json["devices"].map{ |atts| new(client, atts) } if res.success?
|
30
30
|
end
|
31
31
|
|
32
|
-
# List Device
|
33
|
-
# Retrieve the list of device
|
32
|
+
# List Device Tags
|
33
|
+
# Retrieve the list of device tags for the authenticated user.
|
34
34
|
#
|
35
|
-
# https://m2x.att.com/developer/documentation/v2/device#List-Device-
|
36
|
-
def
|
37
|
-
client.get("#{PATH}/
|
35
|
+
# https://m2x.att.com/developer/documentation/v2/device#List-Device-Tags
|
36
|
+
def tags(client)
|
37
|
+
client.get("#{PATH}/tags")
|
38
38
|
end
|
39
39
|
|
40
40
|
# Create a new device
|
@@ -102,7 +102,7 @@ class M2X::Client::Device < M2X::Client::Resource
|
|
102
102
|
# The optional location attribute can contain location information that will
|
103
103
|
# be used to update the current location of the specified device
|
104
104
|
#
|
105
|
-
# https://
|
105
|
+
# https://m2x.att.com/developer/documentation/v2/device#Post-Device-Updates--Multiple-Values-to-Multiple-Streams-
|
106
106
|
def post_updates(params)
|
107
107
|
@client.post("#{path}/updates", nil, params, "Content-Type" => "application/json")
|
108
108
|
end
|
data/lib/m2x/resource.rb
CHANGED
@@ -20,6 +20,12 @@ class M2X::Client::Resource
|
|
20
20
|
@attributes = res.json if res.success?
|
21
21
|
end
|
22
22
|
|
23
|
+
# Refresh the resource details and return self
|
24
|
+
def refresh
|
25
|
+
view
|
26
|
+
self
|
27
|
+
end
|
28
|
+
|
23
29
|
# Update an existing resource details
|
24
30
|
def update!(params)
|
25
31
|
@client.put(path, nil, params, "Content-Type" => "application/json")
|
data/lib/m2x/stream.rb
CHANGED
@@ -7,7 +7,7 @@ class M2X::Client::Stream < M2X::Client::Resource
|
|
7
7
|
#
|
8
8
|
# https://m2x.att.com/developer/documentation/v2/device#View-Data-Stream
|
9
9
|
def fetch(client, device, name)
|
10
|
-
res = client.get("#{device.path}/streams/#{name}")
|
10
|
+
res = client.get("#{device.path}/streams/#{URI.encode(name)}")
|
11
11
|
|
12
12
|
new(client, device, res.json) if res.success?
|
13
13
|
end
|
data/lib/m2x/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: m2x
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leandro López
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-
|
13
|
+
date: 2015-04-02 00:00:00.000000000 Z
|
14
14
|
dependencies: []
|
15
15
|
description: AT&T’s M2X is a cloud-based fully managed data storage service for network
|
16
16
|
connected machine-to-machine (M2M) devices. From trucks and turbines to vending
|