wfa 0.1 → 0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/wfa/device.rb +11 -2
- data/lib/wfa/version.rb +1 -1
- metadata +2 -2
data/lib/wfa/device.rb
CHANGED
@@ -8,7 +8,8 @@ class WFA::Device
|
|
8
8
|
|
9
9
|
ATTRIBUTES = [
|
10
10
|
:id, :name, :tag, :tunnel_port, :macaddr, :secret_key,
|
11
|
-
:state, :vendor, :hostname, :last_heartbeat, :last_ip_addr
|
11
|
+
:state, :vendor, :hostname, :last_heartbeat, :last_ip_addr,
|
12
|
+
:current_network
|
12
13
|
]
|
13
14
|
attr_accessor(*ATTRIBUTES)
|
14
15
|
|
@@ -16,9 +17,17 @@ class WFA::Device
|
|
16
17
|
update attrs
|
17
18
|
end
|
18
19
|
|
20
|
+
def network_ssid
|
21
|
+
current_network && current_network[:ssid]
|
22
|
+
end
|
23
|
+
|
24
|
+
def display_name
|
25
|
+
[name, network_ssid].compact.join(" / ")
|
26
|
+
end
|
27
|
+
|
19
28
|
def to_s
|
20
29
|
"@%s: %s (%d) [%s] %s" % [
|
21
|
-
tag||"---",
|
30
|
+
tag||"---", display_name, id, last_ip_addr,
|
22
31
|
last_heartbeat ? time_ago(Time.parse(last_heartbeat)) : ''
|
23
32
|
]
|
24
33
|
end
|
data/lib/wfa/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wfa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.2'
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-07-
|
12
|
+
date: 2014-07-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: yajl-ruby
|