|
1 | 1 | <img width="100%" src="https://raw.githubusercontent.com/Flagsmith/flagsmith-frontend/master/hero.png"/> |
2 | 2 |
|
3 | | -# Flagsmith Client |
| 3 | +# Flagsmith Ruby Client |
4 | 4 |
|
5 | | -The SDK clients for Ruby [https://flagsmith.com/](https://www.flagsmith.com/). Flagsmith allows you to manage feature flags and remote config across multiple projects, environments and organizations. |
| 5 | +The SDK clients for Ruby [https://www.flagsmith.com/](https://www.flagsmith.com/). Flagsmith allows you to manage feature flags and remote config across multiple projects, environments and organizations. |
6 | 6 |
|
7 | | -## Getting Started |
| 7 | +## Adding to your project |
8 | 8 |
|
9 | | -These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See running in production for notes on how to deploy the project on a live system. |
10 | | - |
11 | | -## Installing |
12 | | - |
13 | | -### VIA gem |
14 | | - |
15 | | -`gem install flagsmith` |
16 | | - |
17 | | -## Usage |
18 | | - |
19 | | -**Retrieving feature flags for your project** |
20 | | - |
21 | | -**For full documentation visit [https://docs.flagsmith.com/](https://docs.flagsmith.com/)** |
22 | | - |
23 | | -```ruby |
24 | | -require "flagsmith" |
25 | | - |
26 | | -flagsmith = Flagsmith.new("<<Your API KEY>>") |
27 | | - |
28 | | -if flagsmith.get_value("font_size") |
29 | | - # Do something awesome with the font size |
30 | | -end |
31 | | - |
32 | | -if flagsmith.feature_enabled?("does_not_exist") |
33 | | - #do something |
34 | | -else |
35 | | - #do nothing, or something else |
36 | | -end |
37 | | - |
38 | | -``` |
39 | | - |
40 | | -**Available Options** |
41 | | - |
42 | | -| Property | Description | Required | Default Value | Environment Key | |
43 | | -| --------- | :-----------------------------------------------------------------------------------------------: | -------: | --------------------------------: | ----------------: | |
44 | | -| `api_key` | Defines which project environment you wish to get flags for. _example ACME Project - Staging._ | **YES** | null | FLAGSMITH_API_KEY | |
45 | | -| `url` | Use this property to define where you're getting feature flags from, e.g. if you're self hosting. | **NO** | https://api.flagsmith.com/api/v1/ | FLAGSMITH_URL | |
46 | | - |
47 | | -**Available Functions** |
48 | | - |
49 | | -| Property | Description | |
50 | | -| ------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------: | |
51 | | -| `init` | Initialize the sdk against a particular environment | |
52 | | -| `feature_enabled?(key)` | Get the value of a particular feature e.g. `flagsmith.feature_enabled?("powerUserFeature") // true` | |
53 | | -| `feature_enabled?(key, user_id, default = false)` | Get the value of a particular feature for a user e.g. `flagsmith.feature_enabled?("powerUserFeature", 1234) // true` | |
54 | | -| `get_value(key)` | Get the value of a particular feature e.g. `flagsmith.get_value("font_size") // 10` | |
55 | | -| `get_value(key, user_id, default = nil)` | Get the value of a particular feature for a specified user e.g. `flagsmith.get_value("font_size", 1234) // 15` | |
56 | | -| `get_flags()` | Trigger a manual fetch of the environment features, if a user is identified it will fetch their features | |
57 | | -| `get_flags(user_id)` | Trigger a manual fetch of the environment features with a given user id | |
58 | | -| `set_trait(user_id, trait, value)` | Set the value of a trait for the given user id | |
59 | | - |
60 | | -**Identifying Users** |
61 | | - |
62 | | -Identifying users allows you to target specific users from the [Flagsmith dashboard](https://www.flagsmith.com/). |
63 | | -You can include an optional user identifier as part of the `feature_enabled?` and `get_value` methods to retrieve unique user flags and variables. |
| 9 | +For full documentation visit [https://docs.flagsmith.com/clients/ruby/](https://docs.flagsmith.com/clients/ruby/) |
64 | 10 |
|
65 | 11 | ## Contributing |
66 | 12 |
|
67 | | -Please read [CONTRIBUTING.md](https://gist.github.com/kyle-ssg/c36a03aebe492e45cbd3eefb21cb0486) for details on our code of conduct, and the process for submitting pull requests to us. |
| 13 | +Please read [CONTRIBUTING.md](https://gist.github.com/kyle-ssg/c36a03aebe492e45cbd3eefb21cb0486) for details on our code of conduct, and the process for submitting pull requests |
68 | 14 |
|
69 | 15 | ## Getting Help |
70 | 16 |
|
71 | 17 | If you encounter a bug or feature request we would like to hear about it. Before you submit an issue please search existing issues in order to prevent duplicates. |
72 | 18 |
|
73 | 19 | ## Get in touch |
74 | 20 |
|
75 | | -If you have any questions about our projects you can email <a href="mailto:projects@solidstategroup.com">projects@solidstategroup.com</a>. |
| 21 | +If you have any questions about our projects you can email <a href="mailto:support@flagsmith.com">support@flagsmith.com</a>. |
76 | 22 |
|
77 | 23 | ## Useful links |
78 | 24 |
|
79 | | -[Website](https://flagsmith.com) |
80 | | - |
81 | | -[Documentation](https://docs.flagsmith.com/) |
| 25 | +[Website](https://www.flagsmith.com/) |
82 | 26 |
|
83 | | -[YouTube Tutorials](https://www.youtube.com/channel/UCki7GZrOdZZcsV9rAIRchCw) |
| 27 | +[Documentation](https://docs.flagsmith.com/) |
0 commit comments