Class: Smarticus::DeliciousConnection
- Inherits:
-
Object
- Object
- Smarticus::DeliciousConnection
- Defined in:
- lib/yummy.rb
Instance Method Summary collapse
- #get(options = {}) ⇒ Object
-
#initialize(user, pass) ⇒ DeliciousConnection
constructor
A new instance of DeliciousConnection.
Constructor Details
#initialize(user, pass) ⇒ DeliciousConnection
Returns a new instance of DeliciousConnection.
62 63 64 65 66 67 68 |
# File 'lib/yummy.rb', line 62 def initialize(user,pass) @user = user @pass = pass @http = Net::HTTP.new("api.del.icio.us", 443) @http.use_ssl = true end |
Instance Method Details
#get(options = {}) ⇒ Object
70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/yummy.rb', line 70 def get(={}) body = "" params = parameterize_hash() path = "/v1/posts/get?" + params @http.start do |http| request = Net::HTTP::Get.new(path, {"User-Agent" => Smarticus::USER_AGENT}) request.basic_auth(@user, @pass) response = @http.request(request) body = response.body end body end |