Introduced Dry :: Struct

reference

https://dry-rb.org/gems/dry-struct/1.0/ https://dry-rb.org/gems/dry-types/1.2/

What i did

Gemfile


gem 'dry-struct'
gem 'dry-types'
bundle

app/models/xxxxx.rb


class Xxxxx < Dry::Struct
  module Types
    include Dry.Types
  end
end

result

-> % bin/rails c
Running via Spring preloader in process 34185
Loading development environment (Rails 6.0.3.3)
[1] pry(main)> Dry::Struct
=> Dry::Struct
[2] pry(main)> Xxxxx
=> Xxxxx

Recommended Posts

Introduced Dry :: Struct
Introduced jacoco