Module: Northpasser

Defined in:
lib/northpasser.rb,
lib/northpasser/request.rb,
lib/northpasser/version.rb,
lib/northpasser/constants.rb,
lib/northpasser/path_builder.rb

Defined Under Namespace

Modules: PathBuilder Classes: Northpass, Request

Constant Summary collapse

VERSION =
"0.1.2"
V1_API_URL =
"https://api.northpass.com/v1/".freeze
FORMATS =

Response formats the northpass api knows about

{
  json: {
    headers: { header: 'Content-Type', content: 'application/json' },
    parser: JSON
  },
  csv: {
    headers: { header: 'Accept', content: 'text/csv' },
    parser: CSV
  }
}.freeze
ACTIONS =

Action words are nice for our internal api and match the api path too

{
  get: :Get,
  update: :Put,
  delete: :Delete,
  list: :Get,
  create: :Post
}.freeze
RESOURCES =

These are the resource for the northpass api and can form part of the path

[
  :assignments,
  :categories,
  :coupons,
  :courses,
  :groups,
  :learners,
  :memberships,
  :people,
  :quizzes
].freeze
EXCEPTIONS =

These are the annoying edge cases in the northpass api that are don’t fit

{
  bulk_people: {
    path: "bulk/people",
    action: :Post
  },
  bulk_groups: {
    path: "bulk/groups",
    action: :Post
  }
}.freeze