Module: Karatekit::Client::Posts

Included in:
Karatekit::Client
Defined in:
lib/karatekit/client/posts.rb

Overview

Methods for the Posts API

See Also:

Instance Method Summary collapse

Instance Method Details

#post(id, options = {}) ⇒ Sawyer::Resource

Get a single post

Parameters:

  • id (Integer)

    ID of the post

Returns:

  • (Sawyer::Resource)

    A single post

See Also:



22
23
24
# File 'lib/karatekit/client/posts.rb', line 22

def post(id, options = {})
  get "posts/#{id}", options
end

#posts(options = {}) ⇒ Array<Sawyer::Resource>

List posts

Returns:

  • (Array<Sawyer::Resource>)

    An array of hashes representing posts

See Also:



13
14
15
# File 'lib/karatekit/client/posts.rb', line 13

def posts(options = {})
  paginate "posts", options
end