Class: Rsift::Connection
- Inherits:
-
Object
- Object
- Rsift::Connection
- Defined in:
- lib/rsift/connection.rb
Instance Method Summary collapse
- #auth_string ⇒ Object
- #get(path) ⇒ Object
-
#initialize(url, key, username) ⇒ Connection
constructor
A new instance of Connection.
Constructor Details
#initialize(url, key, username) ⇒ Connection
Returns a new instance of Connection.
9 10 11 12 13 |
# File 'lib/rsift/connection.rb', line 9 def initialize(url, key, username) @api_url = url @api_key = key @username = username end |
Instance Method Details
#auth_string ⇒ Object
20 21 22 |
# File 'lib/rsift/connection.rb', line 20 def auth_string "&username=#{@username}&api_key=#{@api_key}" end |
#get(path) ⇒ Object
15 16 17 18 |
# File 'lib/rsift/connection.rb', line 15 def get(path) request = "#{@api_url}#{path}#{auth_string}" JSON.parse(Jkl::get_from(request)) end |