Module: Optify

Defined in:
lib/optify_ruby/implementation.rb,
lib/optify_ruby/base_config.rb,
lib/optify_ruby/provider_module.rb,
lib/optify_ruby/options_metadata.rb,
lib/optify_ruby/cache_init_options.rb,
lib/optify_ruby/watcher_implementation.rb,
lib/optify_ruby/get_options_preferences.rb,
sig/optify.rbs,
sig/optify.rbs,
sig/optify.rbs

Overview

A module only for internal use that provides the methods to help implement providers. Some of the methods shown within this module are implemented in Rust and are declared in this common module to avoid duplicate declarations in different classes.

Defined Under Namespace

Modules: CacheMode Classes: BaseConfig, CacheInitOptions, CacheOptions, GetOptionsPreferences, OptionsMetadata, OptionsProvider, OptionsProviderBuilder, OptionsRegistry, OptionsWatcherBuilder, UnknownFeatureError

Instance Method Summary collapse

Instance Method Details

#_get_canonical_feature_namesObject

Map aliases or canonical feature names (perhaps derived from a file names) to the canonical feature names. Canonical feature names map to themselves. This implementation calls the Rust implementation directly.

Parameters:

  • feature_names

    The names of aliases or features.

Returns:

  • The canonical feature names.



208
# File 'sig/optify.rbs', line 208

def _get_canonical_feature_names: (::Array[String] feature_names) -> ::Array[String]

#conditions?Object

Returns Whether the feature has conditions.

Parameters:

  • canonical_feature_name (String)

    A canonical feature name

Returns:

  • Whether the feature has conditions.



153
# File 'sig/optify.rbs', line 153

def conditions?: (String canonical_feature_name) -> bool

#features_with_metadata_jsonObject

Returns All of the keys and values for the the features.

Returns:

  • All of the keys and values for the the features.



156
# File 'sig/optify.rbs', line 156

def features_with_metadata_json: () -> String

#get_canonical_feature_nameObject

Map an alias or canonical feature name (perhaps derived from a file name) to a canonical feature name. Canonical feature names map to themselves.

Parameters:

  • feature_name

    The name of an alias or a feature.

Returns:

  • The canonical feature name.



163
# File 'sig/optify.rbs', line 163

def get_canonical_feature_name: (String feature_name) -> String

#get_canonical_feature_namesObject

Map aliases or canonical feature names (perhaps derived from a file names) to the canonical feature names. Canonical feature names map to themselves. This implementation may do an optimization for small arrays.

Parameters:

  • feature_names

    The names of aliases or features.

Returns:

  • The canonical feature names.



171
# File 'sig/optify.rbs', line 171

def get_canonical_feature_names: (::Array[String] feature_names) -> ::Array[String]

#get_feature_metadataObject

Returns The metadata for the feature.

Parameters:

  • canonical_feature_name (String)

Returns:

  • The metadata for the feature.



174
# File 'sig/optify.rbs', line 174

def get_feature_metadata: (String canonical_feature_name) -> OptionsMetadata?

#get_feature_metadata_jsonObject

Returns The metadata for the feature.

Parameters:

  • canonical_feature_name (String)

Returns:

  • The metadata for the feature.



211
# File 'sig/optify.rbs', line 211

def get_feature_metadata_json: (String canonical_feature_name) -> String?

#get_filtered_features::Array[String]

Parameters:

Returns:

  • (::Array[String])


176
# File 'sig/optify.rbs', line 176

def get_filtered_features: (::Array[String] feature_names, GetOptionsPreferences preferences) -> ::Array[String]

#get_optionsvoid

This method returns an undefined value.



178
# File 'sig/optify.rbs', line 178

def get_options: [Config] (String key, ::Array[String] feature_names, T::Class[Config] config_class, ?CacheOptions? cache_options, ?Optify::GetOptionsPreferences? preferences) -> Config

#get_options_hashHash[String, T.untyped]

Fetches options based on the provided key and feature names.

Parameters:

  • key (String)

    the key to fetch options for.

  • feature_names (Array<String>)

    The enabled feature names to use to build the options.

Returns:

  • (Hash[String, T.untyped])

    the options.



185
# File 'sig/optify.rbs', line 185

def get_options_hash: (String key, ::Array[String] feature_names) -> ::Hash[String, untyped]

#get_options_hash_with_preferences::Hash[String, untyped]

Parameters:

Returns:

  • (::Hash[String, untyped])


187
# File 'sig/optify.rbs', line 187

def get_options_hash_with_preferences: (String key, ::Array[String] feature_names, GetOptionsPreferences preferences) -> ::Hash[String, untyped]

#get_options_jsonString

Fetches options in JSON format based on the provided key and feature names.

Parameters:

  • key (String)

    the key to fetch options for.

  • feature_names (Array<String>)

    The enabled feature names to use to build the options.

Returns:

  • (String)

    the options in JSON.



194
# File 'sig/optify.rbs', line 194

def get_options_json: (String key, ::Array[String] feature_names) -> String

#get_options_json_with_preferencesString

Parameters:

Returns:

  • (String)


196
# File 'sig/optify.rbs', line 196

def get_options_json_with_preferences: (String key, ::Array[String] feature_names, GetOptionsPreferences preferences) -> String

#initself

Parameters:

Returns:

  • (self)


198
# File 'sig/optify.rbs', line 198

def init: (?CacheInitOptions? cache_init_options) -> self

#map_feature_names::Array[String?]

Parameters:

Returns:

  • (::Array[String?])


200
# File 'sig/optify.rbs', line 200

def map_feature_names: (::Array[String] feature_names, GetOptionsPreferences preferences) -> ::Array[String?]