Sha256: 00ecaa12e58d5196768071862fca3e13e22e6625493ccb574ea5ec4e8e18c24c

Contents?: true

Size: 389 Bytes

Versions: 8

Compression:

Stored size: 389 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

8 entries across 8 versions & 1 rubygems

Version Path
reform-2.6.2 lib/reform/form/call.rb
reform-2.6.1 lib/reform/form/call.rb
reform-2.6.0 lib/reform/form/call.rb
reform-2.5.0 lib/reform/form/call.rb
reform-2.3.3 lib/reform/form/call.rb
reform-2.3.2 lib/reform/form/call.rb
reform-2.3.1 lib/reform/form/call.rb
reform-2.3.0.rc2 lib/reform/form/call.rb