class Formally::Config
Attributes
schema[RW]
Public Instance Methods
new(instance)
click to toggle source
# File lib/formally/config.rb, line 5 def new instance Formally::State.new \ schema: schema_for(instance), transaction: transaction end
Private Instance Methods
build_schema(*args)
click to toggle source
# File lib/formally/config.rb, line 21 def build_schema *args _schema = schema Dry::Validation.Form base do instance_exec(*args, &_schema) end end
schema_for(instance)
click to toggle source
# File lib/formally/config.rb, line 13 def schema_for instance if schema.arity.zero? @_cached_schema ||= build_schema instance else build_schema instance end end