Class: LgPodPlugin::Ping

Inherits:
Object
  • Object
show all
Defined in:
lib/lg_pod_plugin/net/net-ping.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url) ⇒ Ping

Returns a new instance of Ping.



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/lg_pod_plugin/net/net-ping.rb', line 11

def initialize(url)
  uri = LURI.new(url)
  if uri.host
    self.uri = uri
    self.ip = uri.host
    self.network_ok = true
  else
    self.uri = nil
    self.ip = nil
    self.network_ok = false
  end
end

Instance Attribute Details

#ipObject

Returns the value of attribute ip.



8
9
10
# File 'lib/lg_pod_plugin/net/net-ping.rb', line 8

def ip
  @ip
end

#network_okObject

Returns the value of attribute network_ok.



9
10
11
# File 'lib/lg_pod_plugin/net/net-ping.rb', line 9

def network_ok
  @network_ok
end

#uriObject

Returns the value of attribute uri.



10
11
12
# File 'lib/lg_pod_plugin/net/net-ping.rb', line 10

def uri
  @uri
end