Class: Copyleaks::CopyleaksImageShapeModel
- Inherits:
-
Object
- Object
- Copyleaks::CopyleaksImageShapeModel
- Defined in:
- lib/copyleaks/models/imageDetection/responses/CopyleaksImageShapeModel.rb
Overview
Dimensions of the analyzed image.
Instance Attribute Summary collapse
-
#height ⇒ Object
Height of the image in pixels.
-
#width ⇒ Object
Width of the image in pixels.
Class Method Summary collapse
-
.from_json(json_hash) ⇒ Object
Create instance from JSON hash.
Instance Method Summary collapse
-
#initialize(height: nil, width: nil) ⇒ CopyleaksImageShapeModel
constructor
Initialize a new CopyleaksImageShapeModel.
-
#to_json(*args) ⇒ Object
Convert to JSON.
Constructor Details
#initialize(height: nil, width: nil) ⇒ CopyleaksImageShapeModel
Initialize a new CopyleaksImageShapeModel
40 41 42 43 |
# File 'lib/copyleaks/models/imageDetection/responses/CopyleaksImageShapeModel.rb', line 40 def initialize(height: nil, width: nil) @height = height @width = width end |
Instance Attribute Details
#height ⇒ Object
Height of the image in pixels.
31 32 33 |
# File 'lib/copyleaks/models/imageDetection/responses/CopyleaksImageShapeModel.rb', line 31 def height @height end |
#width ⇒ Object
Width of the image in pixels.
34 35 36 |
# File 'lib/copyleaks/models/imageDetection/responses/CopyleaksImageShapeModel.rb', line 34 def width @width end |
Class Method Details
.from_json(json_hash) ⇒ Object
Create instance from JSON hash
46 47 48 49 50 51 52 53 |
# File 'lib/copyleaks/models/imageDetection/responses/CopyleaksImageShapeModel.rb', line 46 def self.from_json(json_hash) return nil if json_hash.nil? new( height: json_hash['height'], width: json_hash['width'] ) end |
Instance Method Details
#to_json(*args) ⇒ Object
Convert to JSON
56 57 58 59 60 61 |
# File 'lib/copyleaks/models/imageDetection/responses/CopyleaksImageShapeModel.rb', line 56 def to_json(*args) { 'height' => @height, 'width' => @width }.to_json(*args) end |