Skip to content

cortex-cms/cortex-client-ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

0606bb2 · Dec 17, 2015

History

69 Commits
Dec 17, 2015
Sep 16, 2015
Oct 1, 2015
Oct 1, 2015
Apr 10, 2014
Oct 1, 2015
Dec 1, 2015
Apr 10, 2014
Oct 1, 2015

Repository files navigation

cortex-client-ruby

Build Status Gem Version

Ruby client library for cortex's API.

Constructor

require 'cortex-client'

client = Cortex::Client.new(access_token: 'access_token')

client.posts.query().each do |post|
  puts post
end

Alternatively, cortex-client will handle OAuth2 authentication for you:

require 'cortex-client'

client = Cortex::Client.new(key: 'my-app-id', secret: 'secrey-key-ssh', base_url: 'base_url')
 
 client.posts.query().each do |post|
  puts post
 end

Result object

Cortex::Client will return a Cortex::Result object. The following methods are available:

  • contents
  • is_error?
  • errors
  • page
  • per_page
  • total_items
  • range
  • range_start
  • range_end
  • raw_headers

Supported Endpoints

  • Users - me, get, save
  • Posts - query, get, save, delete, feed, feed/get, feed/get/released, feed/authors
  • Webpages - feed

TODO

  • Handle pagination
  • /media