Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > whole class into a text file...

Reply
Thread Tools

whole class into a text file...

 
 
Pokkai Dokkai
Guest
Posts: n/a
 
      10-26-2007
Is there any method or idea to get whole class into a text file ?
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Axel Etzold
Guest
Posts: n/a
 
      10-26-2007
-------- Original-Nachricht --------
> Datum: Fri, 26 Oct 2007 16:17:51 +0900
> Von: Pokkai Dokkai <(E-Mail Removed)>
> An: http://www.velocityreviews.com/forums/(E-Mail Removed)
> Betreff: whole class into a text file...


> Is there any method or idea to get whole class into a text file ?
> --
> Posted via http://www.ruby-forum.com/.




Dear Pokkai,

maybe this

http://www.headius.com/rubyspec/index.php/Marshaling

is what you mean.

Best regards,

Axel

--
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail

 
Reply With Quote
 
 
 
 
Alex Gutteridge
Guest
Posts: n/a
 
      10-26-2007
On 26 Oct 2007, at 16:17, Pokkai Dokkai wrote:

> Is there any method or idea to get whole class into a text file ?


If you are still asking about this:

http://blade.nagaokaut.ac.jp/cgi-bin...by-talk/273496

Then here is a start:

alexg@alexgdell:~/Desktop$ cat r2r.rb
require 'ruby2ruby'

class Foo
def bar(a)
return "foobar"
end
end

class Class
def to_ruby
str = "class #{self}\n"
self.instance_methods(false).each do |sym|
str << RubyToRuby.translate(self,sym.to_sym) + "\n"
end
str << "end\n"
end
end

puts Foo.to_ruby

alexg@alexgdell:~/Desktop$ ruby r2r.rb
class Foo
def bar(a)
return "foobar"
end
end


Alex Gutteridge

Bioinformatics Center
Kyoto University



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Split text into equal characters but keeping whole words John Butler Ruby 2 06-03-2010 06:48 PM
*WITHOUT* using: ValidateRequest="False" for the whole page (or my whole site).... \A_Michigan_User\ ASP .Net 2 08-21-2006 02:13 PM
How to import whole namespace into global symbol table? (newbie) Scott Simpson Python 2 04-28-2006 05:51 AM
Nested Class, Member Class, Inner Class, Local Class, Anonymous Class E11 Java 1 10-12-2005 03:34 PM



Advertisments