Module: GitlabInternalEventsCli::Helpers::MetricOptions
- Included in:
- GitlabInternalEventsCli::Helpers
- Defined in:
- lib/gitlab_internal_events_cli/helpers/metric_options.rb
Defined Under Namespace
Classes: EventSelection, Option
Instance Method Summary collapse
-
#get_metric_options(events) ⇒ Array<Hash>
Creates a list of metrics to be used as options in a select/multiselect menu; existing metrics and metrics for unavailable identifiers are marked as disabled.
Instance Method Details
#get_metric_options(events) ⇒ Array<Hash>
Creates a list of metrics to be used as options in a select/multiselect menu; existing metrics and metrics for unavailable identifiers are marked as disabled
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/gitlab_internal_events_cli/helpers/metric_options.rb', line 16 def (events) selection = EventSelection.new(events) = [] = [] = (selection.actions) .each do |metric| # Filters & breaks up menu items based on existing metrics # and supported functionality, appending formatted options # to available_options and disabled_options arrays (metric, selection, , ) end # Push disabled options to the end for better skimability; # retain relative order for continuity + end |