Module: Posts

Included in:
Rubypress::Client
Defined in:
lib/rubypress/posts.rb

Instance Method Summary collapse

Instance Method Details

#deletePost(options = {}) ⇒ Object



38
39
40
41
42
43
# File 'lib/rubypress/posts.rb', line 38

def deletePost(options = {})
  default_options = {
    :post_id => nil
  }.deep_merge!(options)
  execute('deletePost', default_options)
end

#editPost(options = {}) ⇒ Object



30
31
32
33
34
35
36
# File 'lib/rubypress/posts.rb', line 30

def editPost(options = {})
   default_options = {
    :post_id => nil,
    :content => {}
  }.deep_merge!(options)
  execute('editPost', default_options)
end

#getPost(options = {}) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/rubypress/posts.rb', line 3

def getPost(options = {})
  default_options = {
    :post_id => nil,
    :fields => self.default_post_fields
  }.deep_merge!(options)
  execute('getPost', default_options)
end

#getPostFormats(options = {}) ⇒ Object



61
62
63
64
65
66
# File 'lib/rubypress/posts.rb', line 61

def getPostFormats(options = {})
  default_options = {
    :filter => {}
  }.deep_merge!(options)
  execute('getPostFormats', default_options)
end

#getPosts(options = {}) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/rubypress/posts.rb', line 11

def getPosts(options = {})
  default_options = {
    :filter => {
      :post_type => 'post',
      :orderby => 'post_date',
      :order => 'asc',
      :fields => self.default_post_fields
    }
  }.deep_merge!(options)
  execute('getPosts', default_options)
end

#getPostStatusList(options = {}) ⇒ Object



68
69
70
# File 'lib/rubypress/posts.rb', line 68

def getPostStatusList(options = {})
  execute('getPostFormats', options)
end

#getPostType(options = {}) ⇒ Object



45
46
47
48
49
50
51
# File 'lib/rubypress/posts.rb', line 45

def getPostType(options = {})
  default_options = {
    :post_type_name => nil,
    :fields => []
  }.deep_merge!(options)
  execute('getPostType', default_options)
end

#getPostTypes(options = {}) ⇒ Object



53
54
55
56
57
58
59
# File 'lib/rubypress/posts.rb', line 53

def getPostTypes(options = {})
  default_options = {
    :filter => {},
    :fields => []
  }.deep_merge!(options)
  execute('getPostTypes', default_options)
end

#newPost(options = {}) ⇒ Object



23
24
25
26
27
28
# File 'lib/rubypress/posts.rb', line 23

def newPost(options = {})
  default_options = {
    :content => {}
  }.deep_merge!(options)
  execute('newPost', default_options)
end