Class: Ubiquitously::DzoneSnippets::Post
- Inherits:
-
Service::Post
- Object
- Base
- Service::Post
- Ubiquitously::DzoneSnippets::Post
- Defined in:
- lib/ubiquitously/services/dzone_snippets.rb
Instance Attribute Summary
Attributes inherited from Service::Post
#captcha, #categories, #description, #downvotes, #extension, #format, #image, #kind, #must_be_unique, #privacy, #rating, #remote, #service_id, #service_url, #slug, #source, #source_url, #state, #status, #tags, #title, #token, #upvotes, #url, #user, #vote
Instance Method Summary collapse
Methods inherited from Service::Post
Methods included from Loggable::Post
Methods included from Restful::Post
Methods included from Postable::Post
Methods included from Ownable::Post
Methods inherited from Base
Methods included from SubclassableCallbacks
Constructor Details
This class inherits a constructor from Ubiquitously::Service::Post
Instance Method Details
#create ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/ubiquitously/services/dzone_snippets.rb', line 25 def create page = agent.get("http://snippets.dzone.com/") form = page.form_with(:action => "/posts/create") form["post[title]"] = token[:title] form["post[content]"] = token[:description] form["post[tag_list]"] = token[:tags] form["post[private]"] = 1 if private? page = form.submit true end |
#tokenize ⇒ Object
18 19 20 21 22 23 |
# File 'lib/ubiquitously/services/dzone_snippets.rb', line 18 def tokenize super.merge( :description => "<code>#{self.description}</code>", :tags => .taggify("-", " ", 40) ) end |