Method: Gitlab::CLI::Helpers.get_keys
- Defined in:
- lib/gitlab/cli_helpers.rb
permalink .get_keys(args, data) ⇒ Object
Helper function to get rows and keys from data returned from API call
199 200 201 202 203 204 205 |
# File 'lib/gitlab/cli_helpers.rb', line 199 def get_keys(args, data) arr = data.map(&:to_h) keys = arr.first.keys.sort_by(&:to_s) keys &= required_fields(args) if required_fields(args).any? keys -= excluded_fields(args) [arr, keys] end |