Class: Ghub::Models::Restriction
- Inherits:
-
Struct
- Object
- Struct
- Ghub::Models::Restriction
- Defined in:
- lib/ghub/models/restriction.rb
Overview
Defines a restriction.
Instance Attribute Summary collapse
-
#apps ⇒ Object
Returns the value of attribute apps.
-
#apps_url ⇒ Object
Returns the value of attribute apps_url.
-
#teams ⇒ Object
Returns the value of attribute teams.
-
#teams_url ⇒ Object
Returns the value of attribute teams_url.
-
#url ⇒ Object
Returns the value of attribute url.
-
#users ⇒ Object
Returns the value of attribute users.
-
#users_url ⇒ Object
Returns the value of attribute users_url.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Restriction
constructor
A new instance of Restriction.
Constructor Details
#initialize ⇒ Restriction
Returns a new instance of Restriction.
27 28 29 30 |
# File 'lib/ghub/models/restriction.rb', line 27 def initialize(**) super freeze end |
Instance Attribute Details
#apps ⇒ Object
Returns the value of attribute apps
6 7 8 |
# File 'lib/ghub/models/restriction.rb', line 6 def apps @apps end |
#apps_url ⇒ Object
Returns the value of attribute apps_url
6 7 8 |
# File 'lib/ghub/models/restriction.rb', line 6 def apps_url @apps_url end |
#teams ⇒ Object
Returns the value of attribute teams
6 7 8 |
# File 'lib/ghub/models/restriction.rb', line 6 def teams @teams end |
#teams_url ⇒ Object
Returns the value of attribute teams_url
6 7 8 |
# File 'lib/ghub/models/restriction.rb', line 6 def teams_url @teams_url end |
#url ⇒ Object
Returns the value of attribute url
6 7 8 |
# File 'lib/ghub/models/restriction.rb', line 6 def url @url end |
#users ⇒ Object
Returns the value of attribute users
6 7 8 |
# File 'lib/ghub/models/restriction.rb', line 6 def users @users end |
#users_url ⇒ Object
Returns the value of attribute users_url
6 7 8 |
# File 'lib/ghub/models/restriction.rb', line 6 def users_url @users_url end |
Class Method Details
.for(**attributes) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/ghub/models/restriction.rb', line 15 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 |