Class: Cliff
- Inherits:
-
Object
show all
- Defined in:
- lib/cliff.rb
Defined Under Namespace
Classes: Helpers, Snippet
Class Method Summary
collapse
Class Method Details
.create(content, params) ⇒ Object
19
20
21
22
23
24
|
# File 'lib/cliff.rb', line 19
def create(content, params)
snippet = Snippet.new(content, params)
snippet.save
Helpers.copy(snippet.url)
return snippet
end
|
.fp_url ⇒ Object
32
33
34
|
# File 'lib/cliff.rb', line 32
def fp_url
"http://www.friendpaste.com/"
end
|
.get(doc_id) ⇒ Object
26
27
28
29
30
|
# File 'lib/cliff.rb', line 26
def get(doc_id)
= {"Accept" => "application/json"}
raw = open("#{Cliff::fp_url}/#{doc_id}", ).read
Snippet.new(JSON.parse(raw))
end
|