Class: Rsift::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/rsift/connection.rb

Instance Method Summary collapse

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_stringObject



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