These are chat archives for dry-rb/chat

4th
Jan 2018
Eugene Khutko
@FoboCasteR
Jan 04 2018 10:12
@GustavoCaso Maybe. But this change will make dry-monads a hard dependency.
Gustavo Caso
@GustavoCaso
Jan 04 2018 10:13
Yes definitely it will make a dependency of dry-types
Pablo Herrero
@pabloh
Jan 04 2018 23:05
Any Idea why this works:
class SubForm < Form
  define! do
    required(:foo).filled(:int?)
    optional(:bar).maybe(:int?)
  end
end

class MainForm < Form
  define! do
    required(:qux).filled(:int?)

    optional(:bar).maybe do
      schema(SubForm.new) # Using new
    end
  end
end
But this doesn't?:
class SubForm < Form
  define! do
    required(:foo).filled(:int?)
    optional(:bar).maybe(:int?)
  end
end

class MainForm < Form
  define! do
    required(:qux).filled(:int?)

    optional(:bar).maybe do
      schema(SubForm) # Using class directly
    end
  end
end