Sha256: a8a98ec9762ae6a13a29b8ad158185f36ac099353d1d82468ea27c1c3791f9c0

Contents?: true

Size: 771 Bytes

Versions: 3

Compression:

Stored size: 771 Bytes

Contents

module Cortex
  class Posts  < Cortex::Resource
    def query(params = {})
      client.get('/posts', params)
    end

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

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

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

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

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

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

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

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

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cortex-client-0.11.0 lib/cortex/posts.rb
cortex-client-0.10.3 lib/cortex/posts.rb
cortex-client-0.10.2 lib/cortex/posts.rb