Class: Athenian::DeploymentMetricID

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

Constant Summary collapse

COUNT =
'dep-count'.freeze
DURATION_ALL =
'dep-duration-all'.freeze
DURATION_SUCCESSFUL =
'dep-duration-successful'.freeze
DURATION_FAILED =
'dep-duration-failed'.freeze
SUCCESS_COUNT =
'dep-success-count'.freeze
FAILURE_COUNT =
'dep-failure-count'.freeze
SUCCESS_RATIO =
'dep-success-ratio'.freeze
CHANGE_FAILURE_COUNT =
'dep-change-failure-count'.freeze
CHANGE_FAILURE_RATIO =
'dep-change-failure-ratio'.freeze
SIZE_PRS =
'dep-size-prs'.freeze
SIZE_RELEASES =
'dep-size-releases'.freeze
SIZE_LINES =
'dep-size-lines'.freeze
SIZE_COMMITS =
'dep-size-commits'.freeze
PRS_COUNT =
'dep-prs-count'.freeze
RELEASES_COUNT =
'dep-releases-count'.freeze
LINES_COUNT =
'dep-lines-count'.freeze
COMMITS_COUNT =
'dep-commits-count'.freeze
JIRA_ISSUES_COUNT =
'dep-jira-issues-count'.freeze
JIRA_BUG_FIXES_COUNT =
'dep-jira-bug-fixes-count'.freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.all_varsObject



35
36
37
# File 'lib/athenian/models/deployment_metric_id.rb', line 35

def self.all_vars
  @all_vars ||= [COUNT, DURATION_ALL, DURATION_SUCCESSFUL, DURATION_FAILED, SUCCESS_COUNT, FAILURE_COUNT, SUCCESS_RATIO, CHANGE_FAILURE_COUNT, CHANGE_FAILURE_RATIO, SIZE_PRS, SIZE_RELEASES, SIZE_LINES, SIZE_COMMITS, PRS_COUNT, RELEASES_COUNT, LINES_COUNT, COMMITS_COUNT, JIRA_ISSUES_COUNT, JIRA_BUG_FIXES_COUNT].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



42
43
44
# File 'lib/athenian/models/deployment_metric_id.rb', line 42

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



49
50
51
52
# File 'lib/athenian/models/deployment_metric_id.rb', line 49

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