Sha256: e10f6eec9c678457fdb095ba305430badc8def1af3c0682b46727dac44504f90

Contents?: true

Size: 1.27 KB

Versions: 3

Compression:

Stored size: 1.27 KB

Contents

=begin
Thinkific::Bundle
bundle = Thinkific::Bundle.get( 'id' )
bundle.courses
chapter = Thinkific::Chapter.get 'id'
chapter.contents

category = Thinkific::Category.get 'id'
categories = Thinkific::Category.all
products = category.products
products[0].delete

new_product = Thinkific::Product.create( :name => 'prod name' )
categories[0].add_product( new_product )

new_category = Thinkfic::Category.create :name => 'cat name', :description => 'cat descr', :slug => 'cat slug'
new_category.update( :description => 'cat descr 2' )
new_category.delete

content = Thinkific::Content.get 'id'

coupons = Thinkific::Coupon.all
coupon = Thinkific::Coupon.get 'id'
new_coupon = Thinkific::Coupon.create :code => '123', :note => 'c note', :quantity => 5

users = Thinkific::User.all
user = Thinkific::User.get 'id'
new_user = Thinkific::User.create :first_name => 'Adam', :last_name => 'Smith'
new_user.update :last_name => 'Jackson'
new_user.delete
=end

module Thinkific
  DOMAIN = 'https://api.thinkific.com'

  def self.headers
    return {
    	'Content-Type' => 'application/json',
      'X-Auth-Subdomain' => ::THINKIFIC_SUBDOMAIN,
      'X-Auth-API-Key' => ::THINKIFIC_KEY
    }
  end

  def self.query
  	return { :limit => 10000 }
  end

end

require 'thinkific/course'
require 'thinkific/user'

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
thinkific-0.0.5 lib/thinkific.rb
thinkific-0.0.4 lib/thinkific.rb
thinkific-0.0.3 lib/thinkific.rb