Class: Copyleaks::CopyleaksTextModerationLabel
- Inherits:
-
Object
- Object
- Copyleaks::CopyleaksTextModerationLabel
- Defined in:
- lib/copyleaks/models/textModeration/requests/CopyleaksTextModerationLabel.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Class Method Summary collapse
-
.from_json(json) ⇒ Object
Build from a JSON string or a hash.
Instance Method Summary collapse
-
#initialize(id) ⇒ CopyleaksTextModerationLabel
constructor
A new instance of CopyleaksTextModerationLabel.
-
#to_json(*_args) ⇒ Object
Convert to JSON with “id” key.
Constructor Details
#initialize(id) ⇒ CopyleaksTextModerationLabel
Returns a new instance of CopyleaksTextModerationLabel.
30 31 32 |
# File 'lib/copyleaks/models/textModeration/requests/CopyleaksTextModerationLabel.rb', line 30 def initialize(id) @id = id end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
28 29 30 |
# File 'lib/copyleaks/models/textModeration/requests/CopyleaksTextModerationLabel.rb', line 28 def id @id end |
Class Method Details
.from_json(json) ⇒ Object
Build from a JSON string or a hash
40 41 42 43 |
# File 'lib/copyleaks/models/textModeration/requests/CopyleaksTextModerationLabel.rb', line 40 def self.from_json(json) data = json.is_a?(String) ? JSON.parse(json) : json new(data['id'] || data[:id]) end |
Instance Method Details
#to_json(*_args) ⇒ Object
Convert to JSON with “id” key
35 36 37 |
# File 'lib/copyleaks/models/textModeration/requests/CopyleaksTextModerationLabel.rb', line 35 def to_json(*_args) { 'id' => @id }.to_json end |