Refactored models to reference native Ruby Data objects

Necessary to ensure we reference native Ruby data objects versus the new data objects own by this gem when dealing with JSON Data APIs.

Milestone: patch
This commit is contained in:
Brooke Kuhlmann
2026-01-22 15:17:52 -07:00
parent 775c228bb5
commit ca9ac028e6
6 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ module TRMNL
module API
module Models
# Models the data of the API response.
CurrentScreen = Data.define :refresh_rate, :image_url, :filename do
CurrentScreen = ::Data.define :refresh_rate, :image_url, :filename do
def self.for(attributes) = new(**attributes)
end
end
+1 -1
View File
@@ -4,7 +4,7 @@ module TRMNL
module API
module Models
# Models the data of the API response.
Firmware = Data.define :url, :version do
Firmware = ::Data.define :url, :version do
def self.for(attributes) = new(**attributes)
end
end
+1 -1
View File
@@ -4,7 +4,7 @@ module TRMNL
module API
module Models
# Models the data of the API response.
IPAddress = Data.define :version_4, :version_6 do
IPAddress = ::Data.define :version_4, :version_6 do
def self.for attributes
new(**attributes.transform_keys(ipv4: :version_4, ipv6: :version_6))
end
+1 -1
View File
@@ -4,7 +4,7 @@ module TRMNL
module API
module Models
# Models the data of the API response.
Recipe = Data.define(
Recipe = ::Data.define(
:data,
:total,
:from,
+1 -1
View File
@@ -5,7 +5,7 @@ module TRMNL
module Models
module Recipes
# Models the statistics of the API response.
Statistics = Data.define :installs, :forks
Statistics = ::Data.define :installs, :forks
end
end
end
+1 -1
View File
@@ -4,7 +4,7 @@ module TRMNL
module API
module Models
# Models the data of the API response.
Setup = Data.define :api_key, :friendly_id, :image_url, :message do
Setup = ::Data.define :api_key, :friendly_id, :image_url, :message do
def self.for(attributes) = new(**attributes)
end
end