Class: SpeedtestNet::Config
- Inherits:
-
Object
- Object
- SpeedtestNet::Config
- Defined in:
- lib/speedtest_net/config.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#download ⇒ Object
readonly
Returns the value of attribute download.
-
#latency ⇒ Object
readonly
Returns the value of attribute latency.
-
#server ⇒ Object
readonly
Returns the value of attribute server.
-
#upload ⇒ Object
readonly
Returns the value of attribute upload.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(client, server, download, upload, latency) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(client, server, download, upload, latency) ⇒ Config
Returns a new instance of Config.
15 16 17 18 19 20 21 |
# File 'lib/speedtest_net/config.rb', line 15 def initialize(client, server, download, upload, latency) @client = client @server = server @download = download @upload = upload @latency = latency end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
11 12 13 |
# File 'lib/speedtest_net/config.rb', line 11 def client @client end |
#download ⇒ Object (readonly)
Returns the value of attribute download.
11 12 13 |
# File 'lib/speedtest_net/config.rb', line 11 def download @download end |
#latency ⇒ Object (readonly)
Returns the value of attribute latency.
11 12 13 |
# File 'lib/speedtest_net/config.rb', line 11 def latency @latency end |
#server ⇒ Object (readonly)
Returns the value of attribute server.
11 12 13 |
# File 'lib/speedtest_net/config.rb', line 11 def server @server end |
#upload ⇒ Object (readonly)
Returns the value of attribute upload.
11 12 13 |
# File 'lib/speedtest_net/config.rb', line 11 def upload @upload end |
Class Method Details
.clear_cache ⇒ Object
31 32 33 |
# File 'lib/speedtest_net/config.rb', line 31 def clear_cache @instance_cache = nil end |
.fetch ⇒ Object
24 25 26 27 28 29 |
# File 'lib/speedtest_net/config.rb', line 24 def fetch return @instance_cache unless @instance_cache.nil? elements = fetch_config @instance_cache = create_instance(elements) end |