Class: RVM::Functions::Join

Inherits:
Function show all
Defined in:
lib/rvm/functions/list/join.rb

Overview

The join function is used to join a list to a String. It expects two arguments, the first beeing the list, the second the string to join it by.

Class Method Summary collapse

Methods inherited from Function

call, data_type, execargs, method_missing

Methods included from Plugin

#helper, #included, #plugin_host, #plugin_id, #register_for

Class Method Details

.execute(params, env) ⇒ Object



31
32
33
34
35
36
37
# File 'lib/rvm/functions/list/join.rb', line 31

def Join.execute params, env
	if params.length == 2
		RVM::Classes[:string].new(params[0].join(params[1]))
	else
		RVM::Classes[:error].new(1,"#-1 FUNCTION (#{self.class.to_s}) EXPECTS 2 OR 3 ARGUMENTS BUT GOT #{params.length}")
	end
end

.signatureObject



39
40
41
# File 'lib/rvm/functions/list/join.rb', line 39

def Join.signature
	[:list, :string]
end