Class: Ghub::Models::DismissalRestriction

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

Overview

Defines a dismissal restriction.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDismissalRestriction

Returns a new instance of DismissalRestriction.



26
27
28
29
# File 'lib/ghub/models/dismissal_restriction.rb', line 26

def initialize(**)
  super
  freeze
end

Instance Attribute Details

#appsObject

Returns the value of attribute apps

Returns:

  • (Object)

    the current value of apps



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

def apps
  @apps
end

#teamsObject

Returns the value of attribute teams

Returns:

  • (Object)

    the current value of teams



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

def teams
  @teams
end

#teams_urlObject

Returns the value of attribute teams_url

Returns:

  • (Object)

    the current value of teams_url



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

def teams_url
  @teams_url
end

#urlObject

Returns the value of attribute url

Returns:

  • (Object)

    the current value of url



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

def url
  @url
end

#usersObject

Returns the value of attribute users

Returns:

  • (Object)

    the current value of users



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

def users
  @users
end

#users_urlObject

Returns the value of attribute users_url

Returns:

  • (Object)

    the current value of users_url



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

def users_url
  @users_url
end

Class Method Details

.for(**attributes) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/ghub/models/dismissal_restriction.rb', line 14

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

  new(
    **attributes.merge!(
      apps: attributes[:apps].map { |arguments| Application[**arguments] },
      teams: attributes[:teams].map { |arguments| Team[**arguments] },
      users: attributes[:users].map { |arguments| User[**arguments] }
    )
  )
end