Class: Copyleaks::SubmissionExcludeCode

Inherits:
Object
  • Object
show all
Defined in:
lib/copyleaks/models/submissions/properties/exclude_code.rb

Instance Method Summary collapse

Constructor Details

#initialize(comments = false) ⇒ SubmissionExcludeCode

Returns a new instance of SubmissionExcludeCode.

Parameters:

  • Exclude (Boolean)

    comments from the scan.



28
29
30
31
32
# File 'lib/copyleaks/models/submissions/properties/exclude_code.rb', line 28

def initialize(
  comments = false
)
  @comments = comments
end

Instance Method Details

#as_json(*_args) ⇒ Object



34
35
36
37
38
# File 'lib/copyleaks/models/submissions/properties/exclude_code.rb', line 34

def as_json(*_args)
  {
      comments: @comments,
  }.select { |_k, v| !v.nil? }
end

#to_json(*options) ⇒ Object



40
41
42
# File 'lib/copyleaks/models/submissions/properties/exclude_code.rb', line 40

def to_json(*options)
  as_json(*options).to_json(*options)
end