Class: Kipalog::Post

Inherits:
Object
  • Object
show all
Defined in:
lib/kipalog/post.rb

Class Method Summary collapse

Class Method Details

.bytag(tag_name) ⇒ Object



24
25
26
# File 'lib/kipalog/post.rb', line 24

def bytag(tag_name)
  client.post('/post/bytag', { tag_name: tag_name })
end

.clientObject



4
5
6
# File 'lib/kipalog/post.rb', line 4

def client
  Kipalog::APIClient.new
end

.create(data) ⇒ Object



12
13
14
# File 'lib/kipalog/post.rb', line 12

def create(data)
  client.post('/post', data)
end

.hotObject



16
17
18
# File 'lib/kipalog/post.rb', line 16

def hot
  client.get('/post/hot')
end

.newestObject



20
21
22
# File 'lib/kipalog/post.rb', line 20

def newest
  client.get('/post/newest')
end

.preview(content) ⇒ Object



8
9
10
# File 'lib/kipalog/post.rb', line 8

def preview(content)
  client.post('/post/preview', content: content)
end