Class: Puppeteer::NetworkManager::InternalNetworkCondition
- Inherits:
-
Object
- Object
- Puppeteer::NetworkManager::InternalNetworkCondition
- Defined in:
- lib/puppeteer/network_manager.rb
Instance Attribute Summary collapse
-
#download ⇒ Object
writeonly
Sets the attribute download.
-
#latency ⇒ Object
writeonly
Sets the attribute latency.
-
#offline ⇒ Object
writeonly
Sets the attribute offline.
-
#upload ⇒ Object
writeonly
Sets the attribute upload.
Instance Method Summary collapse
-
#initialize(client) ⇒ InternalNetworkCondition
constructor
A new instance of InternalNetworkCondition.
- #network_condition=(network_condition) ⇒ Object
- #offline_mode=(value) ⇒ Object
Constructor Details
#initialize(client) ⇒ InternalNetworkCondition
Returns a new instance of InternalNetworkCondition.
19 20 21 22 23 24 25 |
# File 'lib/puppeteer/network_manager.rb', line 19 def initialize(client) @client = client @offline = false @upload = -1 @download = -1 @latency = 0 end |
Instance Attribute Details
#download=(value) ⇒ Object (writeonly)
Sets the attribute download
17 18 19 |
# File 'lib/puppeteer/network_manager.rb', line 17 def download=(value) @download = value end |
#latency=(value) ⇒ Object (writeonly)
Sets the attribute latency
17 18 19 |
# File 'lib/puppeteer/network_manager.rb', line 17 def latency=(value) @latency = value end |
#offline=(value) ⇒ Object (writeonly)
Sets the attribute offline
17 18 19 |
# File 'lib/puppeteer/network_manager.rb', line 17 def offline=(value) @offline = value end |
#upload=(value) ⇒ Object (writeonly)
Sets the attribute upload
17 18 19 |
# File 'lib/puppeteer/network_manager.rb', line 17 def upload=(value) @upload = value end |
Instance Method Details
#network_condition=(network_condition) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/puppeteer/network_manager.rb', line 33 def network_condition=(network_condition) if network_condition @upload = network_condition.upload @download = network_condition.download @latency = network_condition.latency else @upload = -1 @download = -1 @latency = 0 end update_network_conditions end |
#offline_mode=(value) ⇒ Object
27 28 29 30 31 |
# File 'lib/puppeteer/network_manager.rb', line 27 def offline_mode=(value) return if @offline == value @offline = value update_network_conditions end |