class Copyleaks::TextModerationsLegend
Attributes
Public Class Methods
Source
# File lib/copyleaks/models/textModeration/responses/submodules/TextModerationsLegend.rb, line 21 def self.from_json(json_string) data = JSON.parse(json_string, symbolize_names: true) new( index: data[:index], id: data[:id] ) end
Source
# File lib/copyleaks/models/textModeration/responses/submodules/TextModerationsLegend.rb, line 9 def initialize(index: 0, id: '') @index = index @id = id end
@param index [integer] The numerical index of the label. @param id [string] A unique string identifier for the label. This ID serves as a machine-readable way to identify the label type.
Public Instance Methods
Source
# File lib/copyleaks/models/textModeration/responses/submodules/TextModerationsLegend.rb, line 14 def to_json(options = {}) { index: @index, id: @id }.to_json(options) end