From ca9ac028e6e0a87ca84563d8fb45a0a2464b6128 Mon Sep 17 00:00:00 2001 From: Brooke Kuhlmann Date: Thu, 22 Jan 2026 14:16:25 -0700 Subject: [PATCH] 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 --- lib/trmnl/api/models/current_screen.rb | 2 +- lib/trmnl/api/models/firmware.rb | 2 +- lib/trmnl/api/models/ip_address.rb | 2 +- lib/trmnl/api/models/recipe.rb | 2 +- lib/trmnl/api/models/recipes/statistics.rb | 2 +- lib/trmnl/api/models/setup.rb | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/trmnl/api/models/current_screen.rb b/lib/trmnl/api/models/current_screen.rb index 43309c0..27f12af 100644 --- a/lib/trmnl/api/models/current_screen.rb +++ b/lib/trmnl/api/models/current_screen.rb @@ -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 diff --git a/lib/trmnl/api/models/firmware.rb b/lib/trmnl/api/models/firmware.rb index 0593cdf..8b12d0c 100644 --- a/lib/trmnl/api/models/firmware.rb +++ b/lib/trmnl/api/models/firmware.rb @@ -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 diff --git a/lib/trmnl/api/models/ip_address.rb b/lib/trmnl/api/models/ip_address.rb index 66e0786..16a59dd 100644 --- a/lib/trmnl/api/models/ip_address.rb +++ b/lib/trmnl/api/models/ip_address.rb @@ -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 diff --git a/lib/trmnl/api/models/recipe.rb b/lib/trmnl/api/models/recipe.rb index 3ecf4bf..c571c17 100644 --- a/lib/trmnl/api/models/recipe.rb +++ b/lib/trmnl/api/models/recipe.rb @@ -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, diff --git a/lib/trmnl/api/models/recipes/statistics.rb b/lib/trmnl/api/models/recipes/statistics.rb index d4c9d30..3632dcf 100644 --- a/lib/trmnl/api/models/recipes/statistics.rb +++ b/lib/trmnl/api/models/recipes/statistics.rb @@ -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 diff --git a/lib/trmnl/api/models/setup.rb b/lib/trmnl/api/models/setup.rb index 5b41615..c144221 100644 --- a/lib/trmnl/api/models/setup.rb +++ b/lib/trmnl/api/models/setup.rb @@ -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