Class: Copyleaks::Repositories
- Inherits:
-
SharedResultsModel
- Object
- SharedResultsModel
- Copyleaks::Repositories
- Defined in:
- lib/copyleaks/models/submissions/webhooks/HelperModels/ResultsModels/Repositories.rb
Instance Attribute Summary collapse
-
#repositoryId ⇒ Object
readonly
Returns the value of attribute repositoryId.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
Attributes inherited from SharedResultsModel
#id, #introduction, #matchedWords, #scanId, #title
Instance Method Summary collapse
- #as_json(*_args) ⇒ Object
-
#initialize(repositoryId:, tags:, **options) ⇒ Repositories
constructor
A new instance of Repositories.
- #metadata ⇒ Object
- #to_json(*options) ⇒ Object
Constructor Details
#initialize(repositoryId:, tags:, **options) ⇒ Repositories
Returns a new instance of Repositories.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/ResultsModels/Repositories.rb', line 27 def initialize(repositoryId:, tags:, **) unless repositoryId.is_a?(String) raise 'Copyleaks::Repositories - repositoryId must be a String' end unless .is_a?(Array) && .all? { |tag| tag.is_a?(Tags) } raise 'Copyleaks::Repositories - tags must be an Array of Tags' end super(**) @repositoryId = repositoryId @tags = end |
Instance Attribute Details
#repositoryId ⇒ Object (readonly)
Returns the value of attribute repositoryId.
23 24 25 |
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/ResultsModels/Repositories.rb', line 23 def repositoryId @repositoryId end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
23 24 25 |
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/ResultsModels/Repositories.rb', line 23 def @tags end |
Instance Method Details
#as_json(*_args) ⇒ Object
46 47 48 49 50 51 |
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/ResultsModels/Repositories.rb', line 46 def as_json(*_args) { repositoryId: @repositoryId, tags: @tags } end |
#metadata ⇒ Object
42 43 44 |
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/ResultsModels/Repositories.rb', line 42 def super end |
#to_json(*options) ⇒ Object
53 54 55 |
# File 'lib/copyleaks/models/submissions/webhooks/HelperModels/ResultsModels/Repositories.rb', line 53 def to_json(*) as_json(*).to_json(*) end |