Class: Ubiquitously::Tumblr::Post

Inherits:
Service::Post show all
Includes:
HTTParty
Defined in:
lib/ubiquitously/services/tumblr.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

#access_token, #initialize

Methods included from Loggable::Post

included

Methods included from Restful::Post

included

Methods included from Postable::Post

included

Methods included from Ownable::Post

included

Methods inherited from Base

#apply, #debug?

Methods included from SubclassableCallbacks

included, override

Constructor Details

This class inherits a constructor from Ubiquitously::Service::Post

Instance Method Details

#createObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/ubiquitously/services/tumblr.rb', line 10

def create
  # type == regular, link, quote, photo, conversation, video, audio, answer
  response = self.class.post("/write", {
    :body => {
      :email => user.username_for(self),
      :password => user.password_for(self),
      :type => "link",
      :name => token[:title],
      :url => token[:url],
      :description => token[:description],
      :tags => token[:tags],
    }
  })
  
  true
end