device-cloud 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -44,6 +44,10 @@ module DeviceCloud
44
44
  attribute "dpLastKnownIp"
45
45
  end
46
46
 
47
+ def metadata
48
+ attribute "dpUserMetaData"
49
+ end
50
+
47
51
  private
48
52
  def attribute(xpath)
49
53
  element.xpath(xpath).text
@@ -1,3 +1,3 @@
1
1
  module DeviceCloud
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
@@ -42,6 +42,7 @@ describe DeviceCloud::DeviceCore do
42
42
  <dpZigbeeCapabilities>383</dpZigbeeCapabilities>
43
43
  <dpCapabilities>68154</dpCapabilities>
44
44
  <grpPath>IVX</grpPath>
45
+ <dpUserMetaData>{}</dpUserMetaData>
45
46
  <dpLastDisconnectTime>2013-11-18T19:22:51.067Z</dpLastDisconnectTime>
46
47
  </DeviceCore>
47
48
  <DeviceCore>
@@ -140,4 +141,17 @@ describe DeviceCloud::DeviceCore do
140
141
  end
141
142
  end
142
143
 
144
+ describe "#metadata" do
145
+ it "returns the user defined metadata for the device" do
146
+ expect(device.metadata).to eql "{}"
147
+ end
148
+
149
+ context "Metadata is not present" do
150
+ subject(:device) { DeviceCloud::DeviceCore.parse(xml).last }
151
+
152
+ it "will return an empty string" do
153
+ expect(device.metadata).to eql ""
154
+ end
155
+ end
156
+ end
143
157
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: device-cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: