Class: Algorithmia::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/algorithmia/client.rb

Direct Known Subclasses

UnauthenticatedClient

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key, api_address = nil) ⇒ Client

Returns a new instance of Client.



6
7
8
9
# File 'lib/algorithmia/client.rb', line 6

def initialize(api_key, api_address=nil)
  @api_key = api_key
  @api_address = api_address || ENV['ALGORITHMIA_API'] || "https://api.algorithmia.com"
end

Instance Attribute Details

#api_addressObject (readonly)

Returns the value of attribute api_address.



4
5
6
# File 'lib/algorithmia/client.rb', line 4

def api_address
  @api_address
end

#api_keyObject (readonly)

Returns the value of attribute api_key.



3
4
5
# File 'lib/algorithmia/client.rb', line 3

def api_key
  @api_key
end

Instance Method Details

#algo(endpoint) ⇒ Object



11
12
13
# File 'lib/algorithmia/client.rb', line 11

def algo(endpoint)
  Algorithmia::Algorithm.new(self, endpoint)
end

#dir(endpoint) ⇒ Object



19
20
21
# File 'lib/algorithmia/client.rb', line 19

def dir(endpoint)
  Algorithmia::DataDirectory.new(self, endpoint)
end

#file(endpoint) ⇒ Object



15
16
17
# File 'lib/algorithmia/client.rb', line 15

def file(endpoint)
  Algorithmia::DataFile.new(self, endpoint)
end