Module: Stumie
Constant Summary collapse
- HOST =
"http://stumie.com/api/profiles/%s?key=%s"
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
Instance Method Summary collapse
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
11 12 13 |
# File 'lib/stumie.rb', line 11 def api_key @api_key end |
Instance Method Details
#pull(email) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/stumie.rb', line 13 def pull(email) md5 = Digest::MD5.hexdigest(email) response = Net::HTTP.get_response URI.parse(HOST % [ md5, api_key ]) response.code =~ /2../ ? parse_json(response.body) : nil end |