An ink-wash creature balances on a tightrope, an envelope in one hand and a coral heart in the other.

feelings

Probabilistic conditionals for Ruby.

A decision model answers a typed question about a value, with a calibrated probability attached to the answer. feelings lets a Ruby conditional ask one directly.

Feelings(email).like?("genuinely urgent")

Branch on the answer instead of a boolean:

Feelings(ticket).like("this customer is about to churn") do |mood|
  mood.yes   { escalate(ticket) }
  mood.maybe { flag_for_review(ticket) }
  mood.no    { close(ticket) }
end

Or pick the closest match out of a small label set:

Feelings(support_message).most_like(:billing, :bug_report, :feature_request, :spam)
# => :bug_report
gem install feelings

Read the docs GitHub RubyGems

The family

feelings is inspired by Probably, a small language for LLM workflows that showed what code reads like when an if can ask a decision model a question.