Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

³õѧruby Ôõô°ÑÒ»¸öÀർÈëÄØ

1. ÀýÈçÔÚ

Person.rb ÖР
Python code:

class Person
def talk
puts "nihao"
end

end




Student.rb
Python code:

class Student < Person
def talk
puts "nihao"
end

end


p = Student.new

p.talk




½á¹û
>ruby Student.rb
Student.rb:1: uninitialized constant Person (NameError)
>Exit code: 1
 

¾­µä ¿á£¡ book_simmone

×Ô¼ºÌí¼ÓrequireÉÏÈ¥¾ÍÐÐÁË¡«¡«¡«²»¹ý·¢ÏÖcsdn ruby on rails Ã²ËÆÈ˲»¶à°¢¡«¡«

²»ÓÃÄÇôÂé·³µÄ£¬ÔÚrubyÖУ¬include¾Í¿ÉÒÔʵÏּ̳Ð
Python code:

class Student
include Person
def talk
puts "nihao"
end

end





Ïà¹ØÎÊ´ð£º

£¨¼±£©ruby µ÷ÓÃvcдµÄ¿âÎļþÎÊÌâ

ÎÒ×Ô¼ºÐ´ÁËÒ»¸ö¿âÎļþ£¬¿âÎļþÄÚ²¿Ã»ÎÊÌâ¡£ÎÒÏÖÔÚÏëÓà ruby£¨rpgÀµ÷ÓÃÕâ¸ö¿â£¬ÏÖÔÚÎÊÌâ³öÀ´ÁË£¬±¨´í£¬ËµµÄÊÇGetProcAddress : nSrv or nSrvA  ºÃÏñÊDz»ÄÜÕÒµ½Õâ¸öº¯Êý°É£¬ nSrv ÊÇÎÒ¿âÎļþÀïµÄÒ»¸öº¯ÊýµÄÃû× ......

Rubyµ½µ×¸ÉÂðµÄ£¿

Ö÷Òª×öÄĸö·½ÃæµÄ£¿ÊDZàÒëÐ͵Äô£¿
Ò»Ãűà³ÌÓïÑÔ£¬²»ÊDZàÒëÐ͵Ä

¿´¿´ÕâÀï°É:
http://www.ruby-lang.org/en/

rubyÊÇһÎâÊÍÐ͵ÄÃæÏò¶ÔÏóÓïÑÔ¡£×î¾ß´ú±íµÄÓ¦ÓÃÊÇrails---web¿ìËÙ¿ª·¢¿ò¼Ü
......

ruby²Ù×÷Îļþ

require 'app/configuration'
module RubyAMF
  module Configuration
    #set the service path used in all requests
    # RubyAMF::App::RequestStore.service_p ......

³õѧruby Ôõô°ÑÒ»¸öÀർÈëÄØ

1. ÀýÈçÔÚ
Person.rb ÖР
Python code:

class Person
def talk
puts "nihao"
end

end
Student.rb
Python code:

class Student < Person
def talk
puts &quo ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ