Class: Packet::Client

Inherits:
Object
  • Object
show all
Includes:
Devices, Facilities, OperatingSystems, Plans, Projects, SshKeys, Users
Defined in:
lib/packet/client.rb,
lib/packet/client/plans.rb,
lib/packet/client/users.rb,
lib/packet/client/devices.rb,
lib/packet/client/projects.rb,
lib/packet/client/ssh_keys.rb,
lib/packet/client/facilities.rb,
lib/packet/client/operating_systems.rb

Defined Under Namespace

Modules: Devices, Facilities, OperatingSystems, Plans, Projects, SshKeys, Users

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Users

#get_user

Methods included from SshKeys

#create_ssh_key, #delete_ssh_key, #get_ssh_key, #list_ssh_keys, #update_ssh_key

Methods included from Projects

#create_project, #delete_project, #get_project, #list_projects, #update_project

Methods included from Plans

#list_plans

Methods included from OperatingSystems

#list_operating_systems

Methods included from Facilities

#list_facilities

Methods included from Devices

#create_device, #delete_device, #get_device, #list_devices, #update_device

Constructor Details

#initialize(auth_token = nil, consumer_token = nil, url = nil) ⇒ Client

Returns a new instance of Client.



15
16
17
18
19
# File 'lib/packet/client.rb', line 15

def initialize(auth_token = nil, consumer_token = nil, url = nil)
  self.url = url || Packet.configuration.url
  self.auth_token = auth_token || Packet.configuration.auth_token
  self.consumer_token = consumer_token || Packet.configuration.consumer_token
end

Instance Attribute Details

#auth_tokenObject

Returns the value of attribute auth_token.



13
14
15
# File 'lib/packet/client.rb', line 13

def auth_token
  @auth_token
end

#consumer_tokenObject

Returns the value of attribute consumer_token.



13
14
15
# File 'lib/packet/client.rb', line 13

def consumer_token
  @consumer_token
end

#urlObject

Returns the value of attribute url.



13
14
15
# File 'lib/packet/client.rb', line 13

def url
  @url
end

Instance Method Details

#inspectObject



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

def inspect
  %(#<#{self.class}:#{format('%014x', (object_id << 1))}>)
end