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