Sha256: 24d42512a8da864823ae45b19f7a185bd64f7d04b9511e3ddceb29f538eab000

Contents?: true

Size: 390 Bytes

Versions: 3

Compression:

Stored size: 390 Bytes

Contents

module Reform::Form::Call
  def call(params, &block)
    bool = validate(params, &block)

    Result.new(bool, self)
  end

  # TODO: the result object might soon come from dry.
  class Result < SimpleDelegator
    def initialize(success, data)
      @success = success
      super(data)
    end

    def success?
      @success
    end

    def failure?
      ! @success
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
reform-2.3.0.rc1 lib/reform/form/call.rb
reform-2.2.4 lib/reform/form/call.rb
reform-2.2.3 lib/reform/form/call.rb