Fruit
and if its name
field was "banana"
then my_fruit.banana?
would return true
. or... should there be helper functions like is_banana?(fruit)
is this something sensible:
def failed(error)
Dry::Monads::Task.new(Concurrent::Promise.reject(error))
end
???
class MyStruct < Base
attribute :id, Types::Strict::Integer
attribute :data do
attribute :code, Types::Strict::Integer.optional.default(nil)
attribute :msg, Types::String.optional.default(nil)
end
end
Base
as default there but Dry::Struct