Traitify is a ruby gem wrapper for Traitify's Personality API


Add this line to your Gemfile (using bundler):

gem "traitify"

Or install it yourself with:

gem install traitify


First, it is helpful to configure Traitify, otherwise everytime you create a Traitify object you must add the configuration


All the configuration options can be found in lib/Traitify/configuration.rb

Traitify.configure do |traitify| = ""
  traitify.version = "v1"
  traitify.secret_key = "secret"
  traitify.public_key = "public" # Optional
  traitify.deck_id = "deck-uuid"  # Optional
  traitify.image_pack = "image-pack-type"  # Optional
  traitify.locale_key = "en-us"  # Optional

With config file:

traitify =

Without config file:

traitify =
  host: "",
  version: "v1",
  secret_key: "secret",
  deck_id: "deck-uuid"


Getting all the decks:

decks = traitify.decks

Returns an array of Deck objects:

deck = decks.first                   #=> "deck-uuid"                 #=> "Career"
deck.description          #=> "Description of deck"
# And more


Creating an assessment:

assessment = traitify.create_assessment

You must can specify the deck in your configuration or override it here

assessment = traitify.create_assessment(deck_id: "deck-uuid")

You can optionally specify image pack or locale

assessment = traitify.create_assessment(image_pack: "full-color")

Returns an assessment object:           #=> "assessment-uuid"
assessment.deck_id      #=> "deck-uuid"
assessment.created_at   #=> Returns time in Epoch format
assessment.completed_at #=> nil

Finding an assessment:

assessment = traitify.find_assessment("assessment-uuid")

Returns an assessment object as seen above

Taking an assessment:

An assessment can be taken through our javascript plugin or by getting the slides and iterating through them

Finding an assessment's slides:

slides = traitify.find_slides("assessment-uuid")

Returns an array of slides

Updating an assessment's slides:! do |slide|
  # true for me, false for not me
  slide.response = true
  # Pass in the time it took to make that choice (milliseconds)
  slide.time_taken = 600

traitify.update_slides("assessment-uuid", slides)

Updating a single assessment slide:

slide = assessment.slides.first
slide.response = true
slide.time_taken = 600
traitify.update_slide(, slide)


Getting an assessment's results

results = traitify.find_results("assessment-uuid")

Returns a results object:

results.personality_blend #=> Personality blend object
results.personality_types #=> Array of personality type objects (with scores)

personality_blend = results.personality_blend
personality_blend.personality_type_1 #=> Personality type object
personality_blend.personality_type_2 #=> Personality type object               #=> "Visionary Creator"
personality_blend.description        #=> "Visionary Creator description"
personality_blend.compliments        #=> "Visionary Creator compliments"
personality_blend.conflicts          #=> "Visionary Creator conflicts"

type = results.personality_types.first
type.score                   #=> 100
personality_type = type.personality_type        #=> "Creator"
personality_type.description #=> "Creator description"
personality_type.badge       #=> Badge object

badge = personality_type.badge
badge.image_small  #=> ""
badge.image_medium #=> ""
badge.image_large  #=> ""

Getting an assessment's personality traits

traits = traitify.raw_personality_traits("assessment-uuid")
trait = traits.first
trait.score #=> 100
personality_trait = trait.personality_trait        #=> "Imaginative"
personality_trait.definition  #=> "Able to think symbolically and play with ideas."
personality_trait.description #=> "Coming Soon"

More results

More API endpoints may be available. You can find more at To make authenticated calls to new endpoints use the syntax below:

traitify.get("/new/endpoint")"/new/endpoint", { ready: true })