HabitatMap/AirCasting

View on GitHub
app/models/api/sensors.rb

Summary

Maintainability
A
0 mins
Test Coverage
require 'dry-validation'
require 'dry-struct'

module Api::Sensors
  module Types
    include Dry::Types.module
  end

  Schema = Dry::Validation.Schema { required(:session_type).filled(:str?) }

  class Struct < Dry::Struct
    transform_keys(&:to_sym)

    attribute :session_type, Types::Strict::String
  end
end