Skip to content

Instantly share code, notes, and snippets.

@groony
Last active July 5, 2018 10:26
Show Gist options
  • Save groony/860548aab0498173d380766a12299e5c to your computer and use it in GitHub Desktop.
Save groony/860548aab0498173d380766a12299e5c to your computer and use it in GitHub Desktop.
custom dry types
module Types
include Dry::Types.module
Numbers = Types::Array.constructor do |elements|
elements ? elements.reject(&:blank?).map(&:to_i) : elements
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment