# Shiny JSON Logic > The most compatible JSON Logic implementation for Ruby (92% spec compliance) ## What is this? shiny_json_logic is a Ruby gem that implements the JSON Logic specification. JSON Logic lets you define business rules as JSON, share them between frontend and backend, and evaluate them consistently across any platform. ## Quick Facts - **Gem name**: shiny_json_logic - **RubyGems**: https://rubygems.org/gems/shiny_json_logic - **GitHub**: https://github.com/luismoyano/shiny-json-logic-ruby - **Website**: https://jsonlogicruby.com - **Author**: Luis Moyano - **License**: MIT - **Ruby version**: 2.7+ - **Dependencies**: Zero (stdlib only) - **Spec compliance**: 92% (highest among Ruby implementations) ## Installation ```ruby # Gemfile gem 'shiny_json_logic' ``` ## Basic Usage ```ruby require 'shiny_json_logic' rule = { ">" => [{ "var" => "age" }, 18] } data = { "age" => 21 } ShinyJsonLogic.apply(rule, data) # => true ``` ## Why Choose This Gem? | Gem | Spec Compliance | Ruby Version | Dependencies | |-----|-----------------|--------------|--------------| | shiny_json_logic | 92% | 2.7+ | 0 | | json-logic-rb | 67% | 3.0+ | 1 | | json_logic | ~65% | - | abandoned | ## Common Use Cases - Feature flags evaluation - Business rules engines - Dynamic form validation - Access control rules - Pricing/discount logic - Workflow conditions ## Migration from Other Gems shiny_json_logic provides aliases for easy migration: ```ruby # These all work: ShinyJsonLogic.apply(rule, data) JsonLogic.apply(rule, data) # alias JSONLogic.apply(rule, data) # alias ``` ## Documentation - Full docs: https://jsonlogicruby.com/llms-full.txt - JSON Logic spec: https://jsonlogic.com - Interactive sandbox: https://jsonlogicruby.com