Class: Ghub::Models::Review

Inherits:
Struct
  • Object
show all
Defined in:
lib/ghub/models/review.rb

Overview

Defines a review.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeReview

Returns a new instance of Review.



23
24
25
26
# File 'lib/ghub/models/review.rb', line 23

def initialize(**)
  super
  freeze
end

Instance Attribute Details

#dismiss_stale_reviewsObject

Returns the value of attribute dismiss_stale_reviews

Returns:

  • (Object)

    the current value of dismiss_stale_reviews



6
7
8
# File 'lib/ghub/models/review.rb', line 6

def dismiss_stale_reviews
  @dismiss_stale_reviews
end

#dismissal_restrictionsObject

Returns the value of attribute dismissal_restrictions

Returns:

  • (Object)

    the current value of dismissal_restrictions



6
7
8
# File 'lib/ghub/models/review.rb', line 6

def dismissal_restrictions
  @dismissal_restrictions
end

#require_code_owner_reviewsObject

Returns the value of attribute require_code_owner_reviews

Returns:

  • (Object)

    the current value of require_code_owner_reviews



6
7
8
# File 'lib/ghub/models/review.rb', line 6

def require_code_owner_reviews
  @require_code_owner_reviews
end

#required_approving_review_countObject

Returns the value of attribute required_approving_review_count

Returns:

  • (Object)

    the current value of required_approving_review_count



6
7
8
# File 'lib/ghub/models/review.rb', line 6

def required_approving_review_count
  @required_approving_review_count
end

#urlObject

Returns the value of attribute url

Returns:

  • (Object)

    the current value of url



6
7
8
# File 'lib/ghub/models/review.rb', line 6

def url
  @url
end

Class Method Details

.for(**attributes) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/ghub/models/review.rb', line 13

def self.for(**attributes)
  return new if attributes.empty?

  new(
    **attributes.merge!(
      dismissal_restrictions: DismissalRestriction.for(**attributes[:dismissal_restrictions])
    )
  )
end