Class: Luminati::Client
- Inherits:
-
Object
- Object
- Luminati::Client
- Defined in:
- lib/luminati/client.rb,
lib/luminati/client/zone.rb,
lib/luminati/client/customer.rb,
lib/luminati/client/zone/ips.rb
Defined Under Namespace
Constant Summary collapse
- API_URL =
"https://luminati.io"
Instance Attribute Summary collapse
-
#api_token ⇒ Object
Returns the value of attribute api_token.
Instance Method Summary collapse
-
#cities(country_code) ⇒ Hash
Returns cities for a given country.
-
#initialize(api_token = nil) ⇒ Luminati::Client
constructor
Initializes a new Client object.
-
#network_status(network_type = :all) ⇒ Hash
Returns the current service status for a given network type.
Methods included from Customer
#customer_balance, #customer_bandwidth_stats
Methods included from Zone::Ips
#add_ips, #remove_ips, #unavailable_zones_ips, #zone_ips
Methods included from Zone
#active_zones, #add_zone, #remove_zone, #zone_available_ip_count, #zone_available_ips, #zone_available_vips, #zone_bandwidth_stats, #zone_cost_stats, #zone_info, #zone_passwords, #zone_permissions, #zone_recent_ips, #zone_status
Constructor Details
#initialize(api_token = nil) ⇒ Luminati::Client
Initializes a new Client object.
20 21 22 |
# File 'lib/luminati/client.rb', line 20 def initialize(api_token = nil) instance_variable_set("@api_token", api_token) if api_token end |
Instance Attribute Details
#api_token ⇒ Object
Returns the value of attribute api_token.
15 16 17 |
# File 'lib/luminati/client.rb', line 15 def api_token @api_token end |
Instance Method Details
#cities(country_code) ⇒ Hash
Returns cities for a given country
36 37 38 |
# File 'lib/luminati/client.rb', line 36 def cities(country_code) request(:get, "/api/cities?country=#{country_code}") end |
#network_status(network_type = :all) ⇒ Hash
Returns the current service status for a given network type
28 29 30 |
# File 'lib/luminati/client.rb', line 28 def network_status(network_type = :all) request(:get, "/api/network_status/#{network_type}") end |