Module: WR::ModAccessor::ModArrayAccess

Defined in:
lib/wrb/base.rb

Instance Method Summary collapse

Instance Method Details

#index(obj) ⇒ Object



392
393
394
395
396
397
398
399
# File 'lib/wrb/base.rb', line 392

def index(obj)
  if obj.is_a?(Integer) && !block_given?
    self.each_with_index{|val, i| return i if (val.idcmd rescue nil)==obj}
    nil
  else
    super
  end
end