Files
trmnl-api/lib/trmnl/api.rb
T
Brooke Kuhlmann ae74630996 Added IP address contract
Necessary to validate `ips` endpoint payloads.

RuboCop has been updated to ignore the use of `ipv4` and `ipv6` since this is a design flaw of the original API design since `version_4` or `version_6` would have been better. This'll soon be corrected (transformed) when the corresponding model is added.

Milestone: minor
2025-12-11 14:53:55 -07:00

25 lines
554 B
Ruby

# frozen_string_literal: true
require "dry/schema"
require "zeitwerk"
Dry::Schema.load_extensions :monads
Zeitwerk::Loader.new.then do |loader|
loader.inflector.inflect "api" => "API", "ip_address" => "IPAddress", "trmnl" => "TRMNL"
loader.tag = "trmnl-api"
loader.push_dir "#{__dir__}/.."
loader.setup
end
module TRMNL
# Main namespace.
module API
def self.loader registry = Zeitwerk::Registry
@loader ||= registry.loaders.each.find { |loader| loader.tag == "trmnl-api" }
end
def self.new(&) = Client.new(&)
end
end