Class: Copyleaks::SubmissionCustomMetadata
- Inherits:
-
Object
- Object
- Copyleaks::SubmissionCustomMetadata
- Defined in:
- lib/copyleaks/models/submissions/properties/custom_metadata.rb
Instance Method Summary collapse
- #as_json(*_args) ⇒ Object
-
#initialize(key, value) ⇒ SubmissionCustomMetadata
constructor
A new instance of SubmissionCustomMetadata.
- #to_json(*options) ⇒ Object
Constructor Details
#initialize(key, value) ⇒ SubmissionCustomMetadata
Returns a new instance of SubmissionCustomMetadata.
28 29 30 31 |
# File 'lib/copyleaks/models/submissions/properties/custom_metadata.rb', line 28 def initialize(key, value) @key = key @value = value end |
Instance Method Details
#as_json(*_args) ⇒ Object
33 34 35 36 37 38 |
# File 'lib/copyleaks/models/submissions/properties/custom_metadata.rb', line 33 def as_json(*_args) { key: @key, value: @value }.select { |_k, v| !v.nil? } end |
#to_json(*options) ⇒ Object
40 41 42 |
# File 'lib/copyleaks/models/submissions/properties/custom_metadata.rb', line 40 def to_json(*) as_json(*).to_json(*) end |