lib/rbbt/workflow/annotate.rb in rbbt-util-4.3.0 vs lib/rbbt/workflow/annotate.rb in rbbt-util-4.4.0

- old
+ new

@@ -1,10 +1,10 @@ module AnnotatedModule def self.extended(base) if not base.respond_to? :inputs class << base - attr_accessor :description, :inputs, :input_types, :input_descriptions, :input_defaults, :result_description, :helpers + attr_accessor :description, :inputs, :input_types, :input_descriptions, :input_defaults, :input_options, :result_description, :helpers def description i = @description; @description = ""; i end @@ -22,10 +22,14 @@ def input_defaults i = @input_defaults; @input_defaults = {}; i end + def input_options + i = @input_options; @input_options = {}; i + end + def description i = @description; @description = ""; i end def result_description @@ -36,10 +40,11 @@ base.description = "" base.inputs = [] base.input_types = {} base.input_descriptions = {} base.input_defaults = {} + base.input_options = {} base.helpers = {} end end @@ -58,16 +63,17 @@ def dep(*dependencies, &block) dependencies << block if block_given? @dependencies.concat dependencies end - def input(name, type = nil, desc = nil, default = nil) + def input(name, type = nil, desc = nil, default = nil, options = nil) name = name.to_sym type = type.to_sym @inputs << name @input_types[name] = type unless type.nil? @input_descriptions[name] = desc unless desc.nil? @input_defaults[name] = default unless default.nil? + @input_options[name] = options unless options.nil? end end