Class: TumblrWrapper::Post

Inherits:
BlogResource show all
Defined in:
lib/tumblr_wrapper/resources/post.rb

Instance Attribute Summary

Attributes inherited from BlogResource

#access_token, #hostname

Attributes inherited from Resource

#access_token

Instance Method Summary collapse

Methods inherited from BlogResource

#blog, #initialize, #post

Methods inherited from Resource

#initialize

Methods included from HTTP

#http_get, #http_post

Methods included from Validators

#validate_not_present, #validate_oauth, #validate_present

Constructor Details

This class inherits a constructor from TumblrWrapper::BlogResource

Instance Method Details

#create(parameters = {}) ⇒ Object

Required parameters: :type www.tumblr.com/docs/en/api/v2#posting



5
6
7
8
9
10
# File 'lib/tumblr_wrapper/resources/post.rb', line 5

def create(parameters = {})
  validate_present(:type, parameters)
  validate_not_present(:id, parameters)

  http_post('post', parameters)
end

#delete(parameters = {}) ⇒ Object

Required parameters: :id www.tumblr.com/docs/en/api/v2#editing



23
24
25
26
# File 'lib/tumblr_wrapper/resources/post.rb', line 23

def delete(parameters = {})
  validate_present(:id, parameters)
  http_post('post/delete', parameters)
end

#update(parameters = {}) ⇒ Object

Required parameters: :id www.tumblr.com/docs/en/api/v2#editing



15
16
17
18
# File 'lib/tumblr_wrapper/resources/post.rb', line 15

def update(parameters = {})
  validate_present(:id, parameters)
  http_post('post/edit', parameters)
end