Class: Athenian::DeveloperMetricID

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

Constant Summary collapse

COMMITS_PUSHED =
'dev-commits-pushed'.freeze
LINES_CHANGED =
'dev-lines-changed'.freeze
PRS_CREATED =
'dev-prs-created'.freeze
PRS_REVIEWED =
'dev-prs-reviewed'.freeze
PRS_MERGED =
'dev-prs-merged'.freeze
RELEASES =
'dev-releases'.freeze
REVIEWS =
'dev-reviews'.freeze
REVIEW_APPROVALS =
'dev-review-approvals'.freeze
REVIEW_REJECTIONS =
'dev-review-rejections'.freeze
REVIEW_NEUTRALS =
'dev-review-neutrals'.freeze
PR_COMMENTS =
'dev-pr-comments'.freeze
REGULAR_PR_COMMENTS =
'dev-regular-pr-comments'.freeze
REVIEW_PR_COMMENTS =
'dev-review-pr-comments'.freeze
ACTIVE =
'dev-active'.freeze
ACTIVE0 =
'dev-active0'.freeze
WORKED =
'dev-worked'.freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.all_varsObject



32
33
34
# File 'lib/athenian/models/developer_metric_id.rb', line 32

def self.all_vars
  @all_vars ||= [COMMITS_PUSHED, LINES_CHANGED, PRS_CREATED, PRS_REVIEWED, PRS_MERGED, RELEASES, REVIEWS, REVIEW_APPROVALS, REVIEW_REJECTIONS, REVIEW_NEUTRALS, PR_COMMENTS, REGULAR_PR_COMMENTS, REVIEW_PR_COMMENTS, ACTIVE, ACTIVE0, WORKED].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



39
40
41
# File 'lib/athenian/models/developer_metric_id.rb', line 39

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



46
47
48
49
# File 'lib/athenian/models/developer_metric_id.rb', line 46

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