mirror of
https://github.com/usetrmnl/trmnl-api.git
synced 2026-04-29 13:35:13 -07:00
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
25 lines
554 B
Ruby
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
|