lib/rbbt/workflow/annotate.rb in rbbt-util-4.0.2 vs lib/rbbt/workflow/annotate.rb in rbbt-util-4.1.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
+ attr_accessor :description, :inputs, :input_types, :input_descriptions, :input_defaults, :result_description, :helpers
def description
i = @description; @description = ""; i
end
@@ -36,11 +36,16 @@
base.description = ""
base.inputs = []
base.input_types = {}
base.input_descriptions = {}
base.input_defaults = {}
+ base.helpers = {}
end
+ end
+
+ def helper(name, &block)
+ @helpers[name] = block
end
def returns(text)
@result_description = text
end