Class: Luminati::Client

Inherits:
Object
  • Object
show all
Includes:
Customer, Zone, Zone::Ips
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

Modules: Customer, Zone

Constant Summary collapse

API_URL =
"https://luminati.io"

Instance Attribute Summary collapse

Instance Method Summary collapse

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.

Parameters:

  • api_token (String) (defaults to: nil)


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_tokenObject

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

Parameters:

  • country_code (String)

    A country code like ‘US`.

Returns:

  • (Hash)

See Also:



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

Parameters:

  • network_type (Symbol) (defaults to: :all)

    A network type, one of ‘:all`, `:res`, `:dc`, `:mobile`.

Returns:

  • (Hash)

See Also:



28
29
30
# File 'lib/luminati/client.rb', line 28

def network_status(network_type = :all)
  request(:get, "/api/network_status/#{network_type}")
end