Class: Algorithmia::Client
- Inherits:
-
Object
- Object
- Algorithmia::Client
- Defined in:
- lib/algorithmia/client.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#api_address ⇒ Object
readonly
Returns the value of attribute api_address.
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
Instance Method Summary collapse
- #algo(endpoint) ⇒ Object
- #dir(endpoint) ⇒ Object
- #file(endpoint) ⇒ Object
-
#initialize(api_key, api_address = nil) ⇒ Client
constructor
A new instance of Client.
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_address ⇒ Object (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_key ⇒ Object (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 |