class Recipe
	
	
	Structured access to an instance method in a bakefile.
Definitions
def initialize(instance, name, method = nil)
Initialize the recipe.
Signature
	- 
					parameter instanceBase
- The instance this recipe is attached to. 
- 
					parameter nameString
- The method name. 
- 
					parameter methodMethod | Nil
- The method if already known. 
Implementation
						def initialize(instance, name, method = nil)
	@instance = instance
	@name = name
	@command = nil
	@comments = nil
	@signature = nil
	@documentation = nil
	
	@method = method
	@arity = nil
endattr :instance
The class Bake::Base instance that this recipe is attached to.
attr :name
The name of this recipe.
def <=>(other)
Sort by location in source file.
Implementation
						def <=> other
	(self.source_location || []) <=> (other.source_location || [])
enddef method
The method implementation.
Implementation
						def method
	@method ||= @instance.method(@name)
enddef source_location
The source location of this recipe.
Implementation
						def source_location
	self.method.source_location
enddef parameters
The recipe's formal parameters, if any.
Signature
	- 
					returns Array | Nil
Implementation
						def parameters
	parameters = method.parameters
	
	unless parameters.empty?
		return parameters
	end
enddef options?
Whether this recipe has optional arguments.
Signature
	- 
					returns Boolean
Implementation
						def options?
	if parameters = self.parameters
		parameters.any? do |type, name|
			type == :keyrest || type == :keyreq || type == :key
		end
	end
enddef output?
If a recipe produces output, we do not need to invoke the default output command.
Signature
	- 
					returns Boolean
- Whether this recipe produces output. 
Implementation
						def output?
	@instance.output?(self)
enddef command
The command name for this recipe.
Implementation
						def command
	@command ||= compute_command
enddef arity
The method's arity, the required number of positional arguments.
Implementation
						def arity
	if @arity.nil?
		@arity = method.parameters.count{|type, name| type == :req}
	end
	
	return @arity
enddef prepare(arguments, last_result = nil)
Process command line arguments into the ordered and optional arguments.
Signature
	- 
					parameter argumentsArray(String)
- The command line arguments 
Implementation
						def prepare(arguments, last_result = nil)
	Arguments.extract(self, arguments, input: last_result)
enddef call(*arguments, **options, &block)
Call the recipe with the specified arguments and options. If the recipe does not accept options, they will be ignored.
Implementation
						def call(*arguments, **options, &block)
	if options.any? and self.options?
		@instance.send(@name, *arguments, **options, &block)
	else
		# Ignore options...
		@instance.send(@name, *arguments, &block)
	end
enddef comments
Any comments associated with the source code which defined the method.
Signature
	- 
					returns Array(String)
- The comment lines. 
Implementation
						def comments
	@comments ||= read_comments
enddef documentation
The documentation object which provides structured access to the Bake::Recipe#comments.
Signature
	- 
					returns Documentation
Implementation
						def documentation
	@documentation ||= Documentation.new(self.comments)
enddef signature
The documented type signature of the recipe.
Signature
	- 
					returns Array
- An array of - module Bake::Typeinstances.
Implementation
						def signature
	@signature ||= read_signature
endalias types signature
- deprecated
Signature
	- deprecated
- Use - Bake::Recipe#signatureinstead.