module Contentstack

Contentstack - Ruby SDK

Contentstack is a content management system that facilitates the process of publication by separating the content from site-related programming and design.

Installation

gem install contentstack

Initialize the Stack

@stack = Contentstack::Client.new("site_api_key", "delivery_token", "enviroment_name")

Initialize the Stack for EU region

@stack = Contentstack::Client.new("site_api_key", "delivery_token", "enviroment_name", {"region": Contentstack::Region::EU })

Initialize the Stack for custom host

@stack = Contentstack::Client.new("site_api_key", "delivery_token", "enviroment_name", {"host": "https://custom-cdn.contentstack.com" })

Usage

Get single entry

@stack.content_type('blog').entry('<entry_uid_here>').fetch

Query entries

@stack.content_type('blog').query.regex('title', '.*hello.*').fetch

Constants

VERSION

Public Class Methods

json_to_html(content, options) click to toggle source
# File lib/contentstack.rb, line 29
def self.json_to_html(content, options)
    ContentstackUtils.json_to_html(content, options)
end
render_content(content, options) click to toggle source
# File lib/contentstack.rb, line 26
def self.render_content(content, options)
    ContentstackUtils.render_content(content, options)
end