Class: Copyleaks::SubmissionLanguage

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

Instance Method Summary collapse

Constructor Details

#initialize(code) ⇒ SubmissionLanguage

Returns a new instance of SubmissionLanguage.

Parameters:

  • code (String)
    • Language code for cross language plagiarism detection.



27
28
29
# File 'lib/copyleaks/models/submissions/properties/language.rb', line 27

def initialize(code)
  @code = code
end

Instance Method Details

#as_json(*_args) ⇒ Object



31
32
33
34
35
# File 'lib/copyleaks/models/submissions/properties/language.rb', line 31

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

#to_json(*options) ⇒ Object



37
38
39
# File 'lib/copyleaks/models/submissions/properties/language.rb', line 37

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