Class: TRMNL::API::Models::Model

Inherits:
Struct
  • Object
show all
Defined in:
lib/trmnl/api/models/model.rb

Overview

Models data for API display responses.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeModel

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_depthObject

Returns the value of attribute bit_depth

Returns:

  • (Object)

    the current value of bit_depth



7
8
9
# File 'lib/trmnl/api/models/model.rb', line 7

def bit_depth
  @bit_depth
end

#colorsObject

Returns the value of attribute colors

Returns:

  • (Object)

    the current value of colors



7
8
9
# File 'lib/trmnl/api/models/model.rb', line 7

def colors
  @colors
end

#cssObject

Returns the value of attribute css

Returns:

  • (Object)

    the current value of css



7
8
9
# File 'lib/trmnl/api/models/model.rb', line 7

def css
  @css
end

#descriptionObject

Returns the value of attribute description

Returns:

  • (Object)

    the current value of description



7
8
9
# File 'lib/trmnl/api/models/model.rb', line 7

def description
  @description
end

#heightObject

Returns the value of attribute height

Returns:

  • (Object)

    the current value of height



7
8
9
# File 'lib/trmnl/api/models/model.rb', line 7

def height
  @height
end

#kindObject

Returns the value of attribute kind

Returns:

  • (Object)

    the current value of kind



7
8
9
# File 'lib/trmnl/api/models/model.rb', line 7

def kind
  @kind
end

#labelObject

Returns the value of attribute label

Returns:

  • (Object)

    the current value of label



7
8
9
# File 'lib/trmnl/api/models/model.rb', line 7

def label
  @label
end

#mime_typeObject

Returns the value of attribute mime_type

Returns:

  • (Object)

    the current value of mime_type



7
8
9
# File 'lib/trmnl/api/models/model.rb', line 7

def mime_type
  @mime_type
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



7
8
9
# File 'lib/trmnl/api/models/model.rb', line 7

def name
  @name
end

#offset_xObject

Returns the value of attribute offset_x

Returns:

  • (Object)

    the current value of offset_x



7
8
9
# File 'lib/trmnl/api/models/model.rb', line 7

def offset_x
  @offset_x
end

#offset_yObject

Returns the value of attribute offset_y

Returns:

  • (Object)

    the current value of offset_y



7
8
9
# File 'lib/trmnl/api/models/model.rb', line 7

def offset_y
  @offset_y
end

#palette_idsObject

Returns the value of attribute palette_ids

Returns:

  • (Object)

    the current value of palette_ids



7
8
9
# File 'lib/trmnl/api/models/model.rb', line 7

def palette_ids
  @palette_ids
end

#rotationObject

Returns the value of attribute rotation

Returns:

  • (Object)

    the current value of rotation



7
8
9
# File 'lib/trmnl/api/models/model.rb', line 7

def rotation
  @rotation
end

#scale_factorObject

Returns the value of attribute scale_factor

Returns:

  • (Object)

    the current value of scale_factor



7
8
9
# File 'lib/trmnl/api/models/model.rb', line 7

def scale_factor
  @scale_factor
end

#widthObject

Returns the value of attribute width

Returns:

  • (Object)

    the current value of 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_jsonObject



32
# File 'lib/trmnl/api/models/model.rb', line 32

def to_json(*) = to_h.to_json(*)