Class: Cortex::Posts

Inherits:
Resource show all
Defined in:
lib/cortex/posts.rb

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from Cortex::Resource

Instance Method Details

#all_posts(params = {}) ⇒ Object



11
12
13
# File 'lib/cortex/posts.rb', line 11

def all_posts(params = {})
  client.get('/posts/feed/all_posts', params)
end

#authorsObject



39
40
41
# File 'lib/cortex/posts.rb', line 39

def authors
  client.get('/posts/feed/authors')
end

#delete(id) ⇒ Object



27
28
29
# File 'lib/cortex/posts.rb', line 27

def delete(id)
  client.delete("/posts/#{id}")
end

#feed(params = {}) ⇒ Object



7
8
9
# File 'lib/cortex/posts.rb', line 7

def feed(params = {})
  client.get('/posts/feed', params)
end

#filtersObject



31
32
33
# File 'lib/cortex/posts.rb', line 31

def filters
  client.get('/posts/filters')
end

#get(id) ⇒ Object



15
16
17
# File 'lib/cortex/posts.rb', line 15

def get(id)
  client.get("/posts/#{id}")
end

#get_published(id) ⇒ Object



19
20
21
# File 'lib/cortex/posts.rb', line 19

def get_published(id)
  client.get("/posts/feed/#{id}")
end

#query(params = {}) ⇒ Object



3
4
5
# File 'lib/cortex/posts.rb', line 3

def query(params = {})
  client.get('/posts', params)
end


35
36
37
# File 'lib/cortex/posts.rb', line 35

def related(id, params = {})
  client.get("/posts/feed/#{id}/related", params)
end

#save(post) ⇒ Object



23
24
25
# File 'lib/cortex/posts.rb', line 23

def save(post)
  client.save('/posts', post)
end