Class: Dovado::Router::Info::Signal

Inherits:
Object
  • Object
show all
Defined in:
lib/dovado/router/info/signal.rb

Overview

Signal Strength object

Since:

  • 1.0.3

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Signal

Returns a new instance of Signal.

Since:

  • 1.0.3



29
30
31
32
33
# File 'lib/dovado/router/info/signal.rb', line 29

def initialize(args)
  @strength = args[:strength].to_i
  @noise = args[:noise].to_i
  @network = args[:network]
end

Instance Attribute Details

#networkString (readonly)

Network type

One of:

  • 2G

  • 3G

  • 4G

Returns:

  • (String)

    current network type

Since:

  • 1.0.3



27
28
29
# File 'lib/dovado/router/info/signal.rb', line 27

def network
  @network
end

#noiseInteger (readonly)

Signal noise level in dBm

Returns:

  • (Integer)

    noise level (dBm)

Since:

  • 1.0.3



17
18
19
# File 'lib/dovado/router/info/signal.rb', line 17

def noise
  @noise
end

#strengthInteger (readonly)

Strength as a percentage

Returns:

  • (Integer)

    an integer from 0 to 100

Since:

  • 1.0.3



12
13
14
# File 'lib/dovado/router/info/signal.rb', line 12

def strength
  @strength
end