Project

General

Profile

Actions

Feature #23143

open

Add tool for easy evaluation of options

Added by Martin Bacovsky about 7 years ago. Updated over 5 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Difficulty:
Triaged:
Yes
Team Backlog:
Fixed in Releases:
Found in Releases:
In Kanboard:

Description

We need easier way to add custom option sources and validations.
In both the ordering matters so we need to be able to specify where the operation should happen.

Example of block that should add option source resolving custom option right after resulution
of decumented options and doing some validation after all sources are done

class MyCommand

  evaluate_options do
    add_source(:after => :id_params, :source => CustomIdParams(self, :required_params => :object_id))
    add_source(:at => :start) { |defined_options, result| result.merge('option' => 'value') }
    add_validation(:at => :end) do
      any(:option_a, :option_b).required
    end
  end

  build_options
end

Actions #1

Updated by Martin Bacovsky about 7 years ago

  • Description updated (diff)
Actions #2

Updated by Shira Maximov over 5 years ago

  • Triaged changed from No to Yes
Actions

Also available in: Atom PDF