class Copyleaks::ModerationsModel
Attributes
Public Class Methods
Source
# File lib/copyleaks/models/textModeration/responses/submodules/ModerationsModel.rb, line 19 def self.from_json(json_string) data = JSON.parse(json_string, symbolize_names: true) new( text: data[:text] ? Text.from_json(data[:text].to_json) : nil ) end
Source
# File lib/copyleaks/models/textModeration/responses/submodules/ModerationsModel.rb, line 8 def initialize(text: Text.new) @text = text end
@param text [Text] Moderated text segments corresponding to the submitted text. Each position in the inner arrays corresponds to a single segment in the textual version.
Public Instance Methods
Source
# File lib/copyleaks/models/textModeration/responses/submodules/ModerationsModel.rb, line 12 def to_json(options = {}) { text: @text ? JSON.parse(@text.to_json) : nil }.to_json(options) end