Module: Freefeed::V1::Posts

Includes:
Utils
Included in:
Client
Defined in:
lib/freefeed/v1/posts.rb

Instance Method Summary collapse

Methods included from Utils

#authenticated_request, #request

Instance Method Details

#create_post(post) ⇒ Object



10
11
12
# File 'lib/freefeed/v1/posts.rb', line 10

def create_post(post)
  authenticated_request(:post, "/v1/posts", json: post)
end

#delete_post(id) ⇒ Object



18
19
20
# File 'lib/freefeed/v1/posts.rb', line 18

def delete_post(id)
  authenticated_request(:delete, "/v1/posts/#{id}")
end

#disable_comments(id) ⇒ Object



46
47
48
# File 'lib/freefeed/v1/posts.rb', line 46

def disable_comments(id)
  authenticated_request(:post, "/v1/posts/#{id}/disableComments")
end

#enable_comments(id) ⇒ Object



50
51
52
# File 'lib/freefeed/v1/posts.rb', line 50

def enable_comments(id)
  authenticated_request(:post, "/v1/posts/#{id}/enableComments")
end

#hide(id) ⇒ Object



30
31
32
# File 'lib/freefeed/v1/posts.rb', line 30

def hide(id)
  authenticated_request(:post, "/v1/posts/#{id}/hide")
end

#like(id) ⇒ Object



22
23
24
# File 'lib/freefeed/v1/posts.rb', line 22

def like(id)
  authenticated_request(:post, "/v1/posts/#{id}/like")
end

#save(id) ⇒ Object



38
39
40
# File 'lib/freefeed/v1/posts.rb', line 38

def save(id)
  authenticated_request(:post, "/v1/posts/#{id}/save")
end

#unhide(id) ⇒ Object



34
35
36
# File 'lib/freefeed/v1/posts.rb', line 34

def unhide(id)
  authenticated_request(:post, "/v1/posts/#{id}/unhide")
end

#unlike(id) ⇒ Object



26
27
28
# File 'lib/freefeed/v1/posts.rb', line 26

def unlike(id)
  authenticated_request(:post, "/v1/posts/#{id}/unlike")
end

#unsave(id) ⇒ Object



42
43
44
# File 'lib/freefeed/v1/posts.rb', line 42

def unsave(id)
  authenticated_request(:delete, "/v1/posts/#{id}/save")
end

#update_post(id, post) ⇒ Object



14
15
16
# File 'lib/freefeed/v1/posts.rb', line 14

def update_post(id, post)
  authenticated_request(:put, "/v1/posts/#{id}", json: post)
end