Should nested structs support metadata?


#1

Is this possible some other way?

require 'dry-types'
require 'dry-struct'

module Types
  include Dry::Types.module
end

class Address < Dry::Struct
  attribute :street, Types::Strict::String.meta(key: 'fk_street')
end

class Customer < Dry::Struct
  attribute :address, Address.meta(key: 'fk_address')
end

customer = Customer.new(address: { street: 'foo' })
/Users/steve/.gem/ruby/2.3.3/gems/dry-configurable-0.7.0/lib/dry/configurable.rb:177:in `method_missing': undefined method `meta' for Address:Class (NoMethodError)
	from /Users/steve/Downloads/example.rb:13:in `<class:Customer>'
	from /Users/steve/Downloads/example.rb:12:in `<main>'