Class: TRMNL::API::Models::Model
- Inherits:
-
Struct
- Object
- Struct
- TRMNL::API::Models::Model
- Defined in:
- lib/trmnl/api/models/model.rb
Overview
Models data for API display responses.
Instance Attribute Summary collapse
-
#bit_depth ⇒ Object
Returns the value of attribute bit_depth.
-
#colors ⇒ Object
Returns the value of attribute colors.
-
#css ⇒ Object
Returns the value of attribute css.
-
#description ⇒ Object
Returns the value of attribute description.
-
#height ⇒ Object
Returns the value of attribute height.
-
#kind ⇒ Object
Returns the value of attribute kind.
-
#label ⇒ Object
Returns the value of attribute label.
-
#mime_type ⇒ Object
Returns the value of attribute mime_type.
-
#name ⇒ Object
Returns the value of attribute name.
-
#offset_x ⇒ Object
Returns the value of attribute offset_x.
-
#offset_y ⇒ Object
Returns the value of attribute offset_y.
-
#palette_ids ⇒ Object
Returns the value of attribute palette_ids.
-
#rotation ⇒ Object
Returns the value of attribute rotation.
-
#scale_factor ⇒ Object
Returns the value of attribute scale_factor.
-
#width ⇒ Object
Returns the value of attribute width.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Model
constructor
A new instance of Model.
- #to_json ⇒ Object
Constructor Details
#initialize ⇒ Model
Returns a new instance of Model.
26 27 28 29 30 |
# File 'lib/trmnl/api/models/model.rb', line 26 def initialize(**) super apply_defaults freeze end |
Instance Attribute Details
#bit_depth ⇒ Object
Returns the value of attribute bit_depth
7 8 9 |
# File 'lib/trmnl/api/models/model.rb', line 7 def bit_depth @bit_depth end |
#colors ⇒ Object
Returns the value of attribute colors
7 8 9 |
# File 'lib/trmnl/api/models/model.rb', line 7 def colors @colors end |
#css ⇒ Object
Returns the value of attribute css
7 8 9 |
# File 'lib/trmnl/api/models/model.rb', line 7 def css @css end |
#description ⇒ Object
Returns the value of attribute description
7 8 9 |
# File 'lib/trmnl/api/models/model.rb', line 7 def description @description end |
#height ⇒ Object
Returns the value of attribute height
7 8 9 |
# File 'lib/trmnl/api/models/model.rb', line 7 def height @height end |
#kind ⇒ Object
Returns the value of attribute kind
7 8 9 |
# File 'lib/trmnl/api/models/model.rb', line 7 def kind @kind end |
#label ⇒ Object
Returns the value of attribute label
7 8 9 |
# File 'lib/trmnl/api/models/model.rb', line 7 def label @label end |
#mime_type ⇒ Object
Returns the value of attribute mime_type
7 8 9 |
# File 'lib/trmnl/api/models/model.rb', line 7 def mime_type @mime_type end |
#name ⇒ Object
Returns the value of attribute name
7 8 9 |
# File 'lib/trmnl/api/models/model.rb', line 7 def name @name end |
#offset_x ⇒ Object
Returns the value of attribute offset_x
7 8 9 |
# File 'lib/trmnl/api/models/model.rb', line 7 def offset_x @offset_x end |
#offset_y ⇒ Object
Returns the value of attribute offset_y
7 8 9 |
# File 'lib/trmnl/api/models/model.rb', line 7 def offset_y @offset_y end |
#palette_ids ⇒ Object
Returns the value of attribute palette_ids
7 8 9 |
# File 'lib/trmnl/api/models/model.rb', line 7 def palette_ids @palette_ids end |
#rotation ⇒ Object
Returns the value of attribute rotation
7 8 9 |
# File 'lib/trmnl/api/models/model.rb', line 7 def rotation @rotation end |
#scale_factor ⇒ Object
Returns the value of attribute scale_factor
7 8 9 |
# File 'lib/trmnl/api/models/model.rb', line 7 def scale_factor @scale_factor end |
#width ⇒ Object
Returns the value of attribute width
7 8 9 |
# File 'lib/trmnl/api/models/model.rb', line 7 def width @width end |
Class Method Details
.for(attributes) ⇒ Object
24 |
# File 'lib/trmnl/api/models/model.rb', line 24 def self.for(attributes) = new(**attributes) |
Instance Method Details
#to_json ⇒ Object
32 |
# File 'lib/trmnl/api/models/model.rb', line 32 def to_json(*) = to_h.to_json(*) |