Skip to content

Latest commit

 

History

History
51 lines (34 loc) · 1.43 KB

README.md

File metadata and controls

51 lines (34 loc) · 1.43 KB

featurevisor-example-ruby

A small Ruby application showing how to use the Featurevisor Ruby SDK.

Learn more about Featurevisor here.

It fetches a production datafile, creates a Featurevisor instance with customer context, then evaluates a flag, a variation, feature variables, and global variables.

Installation

bundle install

Run the example

bundle exec ruby app.rb

The application evaluates commerce_platform, checkout_experience, max_items, payment_methods, serviceEndpoints, and supportContact from this datafile:

https://featurevisor-example-cloudflare.pages.dev/production/featurevisor-sdk-v3.json

Expected output:

Commerce platform enabled: true
Checkout variation: express
Maximum checkout items: 25
Payment methods: ["card", "wallet"]
Service endpoint: https://api.eu.example.com (timeout: 1200 ms, retries: 4)
Support contact: support-nl@example.com

Change the context in app.rb to see how Featurevisor selects different rules, variations, and global variable overrides.

Checks

bundle exec rubocop
bundle exec ruby app.rb

Featurevisor project

The datafile is generated by the Featurevisor Cloudflare example.

Learn more in the Featurevisor Ruby SDK documentation.