Class: GitlabInternalEventsCli::Metric::Key

Inherits:
Struct
  • Object
show all
Defined in:
lib/gitlab_internal_events_cli/metric.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#eventsObject

Returns the value of attribute events

Returns:

  • (Object)

    the current value of events



430
431
432
# File 'lib/gitlab_internal_events_cli/metric.rb', line 430

def events
  @events
end

#identifierObject

Returns the value of attribute identifier

Returns:

  • (Object)

    the current value of identifier



430
431
432
# File 'lib/gitlab_internal_events_cli/metric.rb', line 430

def identifier
  @identifier
end

#operatorObject

Returns the value of attribute operator

Returns:

  • (Object)

    the current value of operator



430
431
432
# File 'lib/gitlab_internal_events_cli/metric.rb', line 430

def operator
  @operator
end

#time_frameObject

Returns the value of attribute time_frame

Returns:

  • (Object)

    the current value of time_frame



430
431
432
# File 'lib/gitlab_internal_events_cli/metric.rb', line 430

def time_frame
  @time_frame
end

Instance Method Details

#full_pathObject



442
443
444
# File 'lib/gitlab_internal_events_cli/metric.rb', line 442

def full_path
  "#{operator.key_path}.#{value}"
end

#value(name_to_display = nil) ⇒ Object

Parameters:

  • name_to_display (String) (defaults to: nil)

    return the key with the provided name instead of a list of event names



433
434
435
436
437
438
439
440
# File 'lib/gitlab_internal_events_cli/metric.rb', line 433

def value(name_to_display = nil)
  [
    operator.verb,
    identifier&.key_path(operator),
    name_to_display || name_for_events,
    time_frame&.key_path
  ].compact.join('_')
end