Class: Athenian::JIRAMetricID

Inherits:
Object
  • Object
show all
Defined in:
lib/athenian/models/jira_metric_id.rb

Constant Summary collapse

OPEN =
'jira-open'.freeze
RESOLVED =
'jira-resolved'.freeze
RAISED =
'jira-raised'.freeze
ACKNOWLEDGED =
'jira-acknowledged'.freeze
ACKNOWLEDGED_Q =
'jira-acknowledged-q'.freeze
LIFE_TIME =
'jira-life-time'.freeze
LIFE_TIME_BELOW_THRESHOLD_RATIO =
'jira-life-time-below-threshold-ratio'.freeze
LEAD_TIME =
'jira-lead-time'.freeze
LEAD_TIME_BELOW_THRESHOLD_RATIO =
'jira-lead-time-below-threshold-ratio'.freeze
ACKNOWLEDGE_TIME =
'jira-acknowledge-time'.freeze
ACKNOWLEDGE_TIME_BELOW_THRESHOLD_RATIO =
'jira-acknowledge-time-below-threshold-ratio'.freeze
PR_LAG_TIME =
'jira-pr-lag-time'.freeze
BACKLOG_TIME =
'jira-backlog-time'.freeze
RESOLUTION_RATE =
'jira-resolution-rate'.freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.all_varsObject



30
31
32
# File 'lib/athenian/models/jira_metric_id.rb', line 30

def self.all_vars
  @all_vars ||= [OPEN, RESOLVED, RAISED, ACKNOWLEDGED, ACKNOWLEDGED_Q, LIFE_TIME, LIFE_TIME_BELOW_THRESHOLD_RATIO, LEAD_TIME, LEAD_TIME_BELOW_THRESHOLD_RATIO, ACKNOWLEDGE_TIME, ACKNOWLEDGE_TIME_BELOW_THRESHOLD_RATIO, PR_LAG_TIME, BACKLOG_TIME, RESOLUTION_RATE].freeze
end

.build_from_hash(value) ⇒ String

Builds the enum from string

Parameters:

  • The (String)

    enum value in the form of the string

Returns:

  • (String)

    The enum value



37
38
39
# File 'lib/athenian/models/jira_metric_id.rb', line 37

def self.build_from_hash(value)
  new.build_from_hash(value)
end

Instance Method Details

#build_from_hash(value) ⇒ String

Builds the enum from string

Parameters:

  • The (String)

    enum value in the form of the string

Returns:

  • (String)

    The enum value



44
45
46
47
# File 'lib/athenian/models/jira_metric_id.rb', line 44

def build_from_hash(value)
  return value if JIRAMetricID.all_vars.include?(value)
  raise "Invalid ENUM value #{value} for class #JIRAMetricID"
end