Class: TRMNL::API::Models::Display

Inherits:
Data
  • Object
show all
Defined in:
lib/trmnl/api/models/display.rb

Overview

Models the data of the API response.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename: nil, firmware_url: nil, firmware_version: nil, image_url: nil, image_url_timeout: 0, maximum_compatibility: false, refresh_rate: 300, reset_firmware: false, special_function: "sleep", temperature_profile: "default", touchbar_mode: "tap", update_firmware: false) ⇒ Display

Returns a new instance of Display.



23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/trmnl/api/models/display.rb', line 23

def initialize filename: nil,
               firmware_url: nil,
               firmware_version: nil,
               image_url: nil,
               image_url_timeout: 0,
               maximum_compatibility: false,
               refresh_rate: 300,
               reset_firmware: false,
               special_function: "sleep",
               temperature_profile: "default",
               touchbar_mode: "tap",
               update_firmware: false
  super
end

Instance Attribute Details

#filenameObject (readonly)

Returns the value of attribute filename

Returns:

  • (Object)

    the current value of filename



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

def filename
  @filename
end

#firmware_urlObject (readonly)

Returns the value of attribute firmware_url

Returns:

  • (Object)

    the current value of firmware_url



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

def firmware_url
  @firmware_url
end

#firmware_versionObject (readonly)

Returns the value of attribute firmware_version

Returns:

  • (Object)

    the current value of firmware_version



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

def firmware_version
  @firmware_version
end

#image_urlObject (readonly)

Returns the value of attribute image_url

Returns:

  • (Object)

    the current value of image_url



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

def image_url
  @image_url
end

#image_url_timeoutObject (readonly)

Returns the value of attribute image_url_timeout

Returns:

  • (Object)

    the current value of image_url_timeout



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

def image_url_timeout
  @image_url_timeout
end

#maximum_compatibilityObject (readonly)

Returns the value of attribute maximum_compatibility

Returns:

  • (Object)

    the current value of maximum_compatibility



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

def maximum_compatibility
  @maximum_compatibility
end

#refresh_rateObject (readonly)

Returns the value of attribute refresh_rate

Returns:

  • (Object)

    the current value of refresh_rate



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

def refresh_rate
  @refresh_rate
end

#reset_firmwareObject (readonly)

Returns the value of attribute reset_firmware

Returns:

  • (Object)

    the current value of reset_firmware



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

def reset_firmware
  @reset_firmware
end

#special_functionObject (readonly)

Returns the value of attribute special_function

Returns:

  • (Object)

    the current value of special_function



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

def special_function
  @special_function
end

#temperature_profileObject (readonly)

Returns the value of attribute temperature_profile

Returns:

  • (Object)

    the current value of temperature_profile



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

def temperature_profile
  @temperature_profile
end

#touchbar_modeObject (readonly)

Returns the value of attribute touchbar_mode

Returns:

  • (Object)

    the current value of touchbar_mode



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

def touchbar_mode
  @touchbar_mode
end

#update_firmwareObject (readonly)

Returns the value of attribute update_firmware

Returns:

  • (Object)

    the current value of update_firmware



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

def update_firmware
  @update_firmware
end

Class Method Details

.for(attributes) ⇒ Object



21
# File 'lib/trmnl/api/models/display.rb', line 21

def self.for(attributes) = new(**attributes)

Instance Method Details

#to_jsonObject



38
# File 'lib/trmnl/api/models/display.rb', line 38

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