Class: Copyleaks::TextModerationsLegend
- Inherits:
-
Object
- Object
- Copyleaks::TextModerationsLegend
- Defined in:
- lib/copyleaks/models/textModeration/responses/submodules/TextModerationsLegend.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#index ⇒ Object
Returns the value of attribute index.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(index: 0, id: '') ⇒ TextModerationsLegend
constructor
A new instance of TextModerationsLegend.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(index: 0, id: '') ⇒ TextModerationsLegend
Returns a new instance of TextModerationsLegend.
9 10 11 12 |
# File 'lib/copyleaks/models/textModeration/responses/submodules/TextModerationsLegend.rb', line 9 def initialize(index: 0, id: '') @index = index @id = id end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/copyleaks/models/textModeration/responses/submodules/TextModerationsLegend.rb', line 5 def id @id end |
#index ⇒ Object
Returns the value of attribute index.
5 6 7 |
# File 'lib/copyleaks/models/textModeration/responses/submodules/TextModerationsLegend.rb', line 5 def index @index end |
Class Method Details
.from_json(json_string) ⇒ Object
21 22 23 24 25 26 27 |
# 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 |
Instance Method Details
#to_json(options = {}) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/copyleaks/models/textModeration/responses/submodules/TextModerationsLegend.rb', line 14 def to_json( = {}) { index: @index, id: @id }.to_json() end |