Class: Ci::Catalog::ValidateResourceService
- Inherits:
-
Object
- Object
- Ci::Catalog::ValidateResourceService
- Defined in:
- app/services/ci/catalog/validate_resource_service.rb
Instance Attribute Summary collapse
-
#project ⇒ Object
readonly
Returns the value of attribute project.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(project, ref) ⇒ ValidateResourceService
constructor
A new instance of ValidateResourceService.
Constructor Details
#initialize(project, ref) ⇒ ValidateResourceService
Returns a new instance of ValidateResourceService.
8 9 10 11 12 |
# File 'app/services/ci/catalog/validate_resource_service.rb', line 8 def initialize(project, ref) @project = project @ref = ref @errors = [] end |
Instance Attribute Details
#project ⇒ Object (readonly)
Returns the value of attribute project.
6 7 8 |
# File 'app/services/ci/catalog/validate_resource_service.rb', line 6 def project @project end |
Instance Method Details
#execute ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'app/services/ci/catalog/validate_resource_service.rb', line 14 def execute check_project_readme check_project_description if errors.empty? ServiceResponse.success else ServiceResponse.error(message: errors.join(' , ')) end end |