Class: RVM::Functions::SetAt

Inherits:
Function show all
Defined in:
lib/rvm/functions/array/set_at.rb

Class Method Summary collapse

Methods inherited from Function

call, data_type, execargs, method_missing, method_missing_old_functions

Methods included from Plugin

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

Class Method Details

.execute(params, env) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/rvm/functions/array/set_at.rb', line 4

def SetAt.execute params, env
  if params.length == 3
    p params
    array = params.shift
    pos = params.shift
    value = params.shift
    p array
    p pos
    p value
    array[pos.to_i] = value
  else
    RVM::Classes[:error].new(1,"FUNCTION (#{self.class}) EXPECTS 3 ARGUMENTS BUT GOT #{params.length}")
  end
end

.signatureObject



19
20
21
# File 'lib/rvm/functions/array/set_at.rb', line 19

def SetAt.signature
  [:list, :number, :any]
end