Class: Copyleaks::CopyleaksSubmissionModel
- Inherits:
-
Object
- Object
- Copyleaks::CopyleaksSubmissionModel
- Defined in:
- lib/copyleaks/models/submissions/submission_model.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#properties ⇒ Object
readonly
Returns the value of attribute properties.
Instance Method Summary collapse
- #as_json(*_args) ⇒ Object
-
#initialize(properties) ⇒ CopyleaksSubmissionModel
constructor
A new instance of CopyleaksSubmissionModel.
- #to_json(*options) ⇒ Object
Constructor Details
#initialize(properties) ⇒ CopyleaksSubmissionModel
Returns a new instance of CopyleaksSubmissionModel.
29 30 31 32 33 34 35 |
# File 'lib/copyleaks/models/submissions/submission_model.rb', line 29 def initialize(properties) unless properties.instance_of?(SubmissionProperties) raise 'Copyleaks::CopyleaksURLSubmissionModel - properties - properties must be of type SubmissionProperties' end @properties = properties end |
Instance Attribute Details
#properties ⇒ Object (readonly)
Returns the value of attribute properties.
26 27 28 |
# File 'lib/copyleaks/models/submissions/submission_model.rb', line 26 def properties @properties end |
Instance Method Details
#as_json(*_args) ⇒ Object
37 38 39 40 41 |
# File 'lib/copyleaks/models/submissions/submission_model.rb', line 37 def as_json(*_args) { properties: @properties }.select { |_k, v| !v.nil? } end |
#to_json(*options) ⇒ Object
43 44 45 |
# File 'lib/copyleaks/models/submissions/submission_model.rb', line 43 def to_json(*) as_json(*).to_json(*) end |