Class: Flagsmith::Config
- Inherits:
-
Object
- Object
- Flagsmith::Config
- Defined in:
- lib/flagsmith/sdk/config.rb
Overview
Config options shared around Engine
Constant Summary collapse
- DEFAULT_API_URL =
'https://edge.api.flagsmith.com/api/v1/'
- OPTIONS =
%i[ environment_key api_url custom_headers request_timeout_seconds enable_local_evaluation environment_refresh_interval_seconds retries enable_analytics default_flag_handler offline_mode offline_handler polling_manager_failure_limit logger ].freeze
Class Method Summary collapse
Instance Method Summary collapse
- #enable_analytics? ⇒ Boolean
- #environment_flags_url ⇒ Object
- #environment_url ⇒ Object
- #identities_url ⇒ Object
-
#initialize(options) ⇒ Config
constructor
A new instance of Config.
- #local_evaluation? ⇒ Boolean
- #offline_mode? ⇒ Boolean
Constructor Details
#initialize(options) ⇒ Config
Returns a new instance of Config.
47 48 49 50 51 |
# File 'lib/flagsmith/sdk/config.rb', line 47 def initialize() build_config() freeze end |
Class Method Details
.environment_key ⇒ Object
100 101 102 |
# File 'lib/flagsmith/sdk/config.rb', line 100 def environment_key ENV.fetch('FLAGSMITH_ENVIRONMENT_KEY', nil) end |
Instance Method Details
#enable_analytics? ⇒ Boolean
57 58 59 |
# File 'lib/flagsmith/sdk/config.rb', line 57 def enable_analytics? @enable_analytics end |
#environment_flags_url ⇒ Object
65 66 67 |
# File 'lib/flagsmith/sdk/config.rb', line 65 def environment_flags_url 'flags/' end |
#environment_url ⇒ Object
73 74 75 |
# File 'lib/flagsmith/sdk/config.rb', line 73 def environment_url 'environment-document/' end |
#identities_url ⇒ Object
69 70 71 |
# File 'lib/flagsmith/sdk/config.rb', line 69 def identities_url 'identities/' end |
#local_evaluation? ⇒ Boolean
53 54 55 |
# File 'lib/flagsmith/sdk/config.rb', line 53 def local_evaluation? @enable_local_evaluation end |
#offline_mode? ⇒ Boolean
61 62 63 |
# File 'lib/flagsmith/sdk/config.rb', line 61 def offline_mode? @offline_mode end |