Class: Artifactory::Permissions::V2::PermissionItems::Base
- Inherits:
-
Object
- Object
- Artifactory::Permissions::V2::PermissionItems::Base
- Defined in:
- lib/artifactory/permissions/v2/permission_items/base.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#permissions ⇒ Object
readonly
Returns the value of attribute permissions.
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
Class Method Summary collapse
Instance Method Summary collapse
- #errors ⇒ Object
- #errors? ⇒ Boolean
-
#initialize(name:, permissions:, scope:) ⇒ Base
constructor
A new instance of Base.
- #valid? ⇒ Boolean
Constructor Details
#initialize(name:, permissions:, scope:) ⇒ Base
Returns a new instance of Base.
16 17 18 19 20 |
# File 'lib/artifactory/permissions/v2/permission_items/base.rb', line 16 def initialize(name:, permissions:, scope:) @name = name.to_s @permissions = Array().map(&:to_s) @scope = scope.to_s end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
14 15 16 |
# File 'lib/artifactory/permissions/v2/permission_items/base.rb', line 14 def name @name end |
#permissions ⇒ Object (readonly)
Returns the value of attribute permissions.
14 15 16 |
# File 'lib/artifactory/permissions/v2/permission_items/base.rb', line 14 def @permissions end |
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
14 15 16 |
# File 'lib/artifactory/permissions/v2/permission_items/base.rb', line 14 def scope @scope end |
Class Method Details
.available_permissions ⇒ Object
6 7 8 |
# File 'lib/artifactory/permissions/v2/permission_items/base.rb', line 6 def self. PERMISSIONS end |
.available_scopes ⇒ Object
10 11 12 |
# File 'lib/artifactory/permissions/v2/permission_items/base.rb', line 10 def self.available_scopes SCOPES end |
Instance Method Details
#errors ⇒ Object
30 31 32 |
# File 'lib/artifactory/permissions/v2/permission_items/base.rb', line 30 def errors @errors ||= Errors.new end |
#errors? ⇒ Boolean
26 27 28 |
# File 'lib/artifactory/permissions/v2/permission_items/base.rb', line 26 def errors? errors.any? end |
#valid? ⇒ Boolean
22 23 24 |
# File 'lib/artifactory/permissions/v2/permission_items/base.rb', line 22 def valid? !errors? end |