jeudi 28 mai 2015

How i can call a passed argument to method in ruby

I want to pass an array object and return it to the caller function.

  eg 
   1.rb
   require '2'
   class A 

   x=B.new
   var = x.func
   puts x
   end
  2.rb
  class B
 def self.func
 #here i have to return same object that is x to var.what to so
 end

Aucun commentaire:

Enregistrer un commentaire