Class: RVM::Functions::At
- Defined in:
- lib/rvm/functions/array/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
5 6 7 8 9 10 11 12 13 |
# File 'lib/rvm/functions/array/at.rb', line 5 def execute params, env if params.length == 2 array = params.shift pos = params.shift array[pos.to_i] else RVM::Classes[:error].new(1,"FUNCTION (#{self.class}) EXPECTS 2 ARGUMENTS BUT GOT #{params.length}") end end |
.signature ⇒ Object
15 16 17 |
# File 'lib/rvm/functions/array/at.rb', line 15 def signature [:list, :number] end |