mind_meld 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mind_meld/device.rb +9 -2
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dfb70f04ebb15443014c384edd275b9fc096f898
4
- data.tar.gz: 7da98327d7f190a83685adc0dc0977090d8e47ba
3
+ metadata.gz: d9d0ba40a18f35d0c355af76acaca4d9ae4bfad4
4
+ data.tar.gz: 1ae4db663fe0273179b6654865edb6f324779f68
5
5
  SHA512:
6
- metadata.gz: d14b18ed6b11045aeb9ec03f3fbe4a2f885cb32bcf8978949510d85c8182c9913f0710b99b20a5fedd233e14dcb0bb7e44c5938552e30a67d820d515ff4f6a86
7
- data.tar.gz: a818e07c8fc0a5b49a934468c355cb9312c29a8dcfc685cda36536295d386cb45318e646628713a7394ccf6d69cffb34fc263e3fb86ea9e4ee78950d4078bfe8
6
+ metadata.gz: 76c96230d574d71f238499d4d653bc0e1e2619d9c2ab52bafe48e0102583ebee039b8519f90f4c39765f5a09b5b28191b993601f50d2819651c0069521e27b1f
7
+ data.tar.gz: 52063c167072582502f024eaa913913c51a23fce1117f8064527e326f41e3aeb9ba4e0448890b435eae440c79c4ad111b74bdc0befa0c5a5d5bbeaffac8f6ecb
@@ -9,6 +9,7 @@ class MindMeld::Device < MindMeld
9
9
 
10
10
  @device = options[:device]
11
11
  # To trigger registration (is this needed?)
12
+ @device_details = {}
12
13
  device_details
13
14
  end
14
15
 
@@ -45,8 +46,14 @@ class MindMeld::Device < MindMeld
45
46
  end
46
47
 
47
48
  def device_details(refresh = false)
48
- if refresh or not @device_details or @device_details.has_key? :error
49
- @device_details = register(@device)
49
+ if refresh || ! @device_details.has_key?(:id)
50
+ if @device_details.has_key? :id
51
+ @device_details = request :get, "devices/#{@device_details[:id]}"
52
+ elsif @device.has_key? :id
53
+ @device_details = request :get, "devices/#{@device[:id]}"
54
+ else
55
+ @device_details = register @device
56
+ end
50
57
  else
51
58
  @device_details
52
59
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mind_meld
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Haig
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-21 00:00:00.000000000 Z
11
+ date: 2016-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport