Class: DPaste::API

Inherits:
Object
  • Object
show all
Defined in:
lib/dpaste/api.rb

Constant Summary collapse

API_URL =
"http://dpaste.com/api/v2/"

Class Method Summary collapse

Class Method Details

.save(string) ⇒ Object



7
8
9
10
11
# File 'lib/dpaste/api.rb', line 7

def self.save(string)
  uri = URI(API_URL)
  response = Net::HTTP.post_form(uri, expiry_days: "10", syntax: "rb", content: string)
  response.body.strip
end