Class: Copyleaks::TextModerationChars
- Inherits:
-
Object
- Object
- Copyleaks::TextModerationChars
- Defined in:
- lib/copyleaks/models/textModeration/responses/submodules/TextModerationChars.rb
Instance Attribute Summary collapse
-
#labels ⇒ Object
Returns the value of attribute labels.
-
#lengths ⇒ Object
Returns the value of attribute lengths.
-
#starts ⇒ Object
Returns the value of attribute starts.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(starts: [], labels: [], lengths: []) ⇒ TextModerationChars
constructor
A new instance of TextModerationChars.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(starts: [], labels: [], lengths: []) ⇒ TextModerationChars
Returns a new instance of TextModerationChars.
10 11 12 13 14 |
# File 'lib/copyleaks/models/textModeration/responses/submodules/TextModerationChars.rb', line 10 def initialize( starts: [],labels: [], lengths: []) @starts = starts @labels = labels @lengths = lengths end |
Instance Attribute Details
#labels ⇒ Object
Returns the value of attribute labels.
5 6 7 |
# File 'lib/copyleaks/models/textModeration/responses/submodules/TextModerationChars.rb', line 5 def labels @labels end |
#lengths ⇒ Object
Returns the value of attribute lengths.
5 6 7 |
# File 'lib/copyleaks/models/textModeration/responses/submodules/TextModerationChars.rb', line 5 def lengths @lengths end |
#starts ⇒ Object
Returns the value of attribute starts.
5 6 7 |
# File 'lib/copyleaks/models/textModeration/responses/submodules/TextModerationChars.rb', line 5 def starts @starts end |
Class Method Details
.from_json(json_string) ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/copyleaks/models/textModeration/responses/submodules/TextModerationChars.rb', line 25 def self.from_json(json_string) data = JSON.parse(json_string, symbolize_names: true) new( labels: data[:labels], starts: data[:starts], lengths: data[:lengths] ) end |
Instance Method Details
#to_json(options = {}) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/copyleaks/models/textModeration/responses/submodules/TextModerationChars.rb', line 17 def to_json( = {}) { labels: @labels, starts: @starts, lengths: @lengths }.to_json() end |