ruby²Ù×÷Îļþ
require 'app/configuration'
module RubyAMF
module Configuration
#set the service path used in all requests
# RubyAMF::App::RequestStore.service_path = File.expand_path(RAILS_ROOT) + '/app/controllers'
# => CLASS MAPPING CONFIGURATION
ClassMappings.register(
:actionscript => 'Stock',
:ruby => 'Stock',
:type => 'active_record',
:attributes => ["code", "name"])
end
end
ClassMappings.register(
:actionscript => 'Rolestock',
:ruby => 'Rolestock',
:type => 'active_record',
:associations => ["stock"],
:attributes => ["id", "cost", "amount"])
ÉÏÃæËãÊÇÕû¸öÎļþ°É£¬Ö®ºóÎÒÔÚÁíÒ»¸öͬµÈ¼¶Â·¾¶ÎļþÏÂÒª²Ù×÷Õâ¸öÎļþ
File.open("rubyamf_config.rb") do |file|
while line = file.gets
Ïà¹ØÎÊ´ð£º
±¾ÈËÓеãC££¸újavaµ××Ó£¬»ØÍ·Ö±½ÓÀ´Ñ§ROR¡£
Ôõô¸Ð¾õROR¾ÍÄÇô¶ñÐÄÈË£¬µ«ÓÖºÜÏëѧºÃ£¬ÆÈÓÚ¸÷·½ÃæÑ¹Á¦Ò²Ö»ÄÜѧϰROR¡£Ñ§ÁË´ó¸ÅÓÐÁ½¸öÔ°ɣ¬¿ÉÎÒ×ܸоõ×Ô¼ºÃŶ¼Ã»Èë¡¡Ì«¶àµÄÉËÐĵϰ¾Í²»Ïë¶à˵ÁË£¬Ö»Ï£Íû¿´µ½µÄ¸ß ......
ÎÒÊÇÓÃnetbeans È¥寫bnf
a program will ONLY accept strings based on the following grammar:
<compute> --> <value> = < ......
ÇëÎÊÓÐûÓÐÈËѧϰRubyÓïÑÔ£¿
Õâ¸öÎÊÌâÓÐʲôÒâÒ壿
¿Ï¶¨ÓÐ
¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£ºÇºÇ
Õâ¸ö¿ÉÒÔÓÐ
žžµØ£¬
¡£¡£¡£Óл¹ÊÇûÓУ¿
ÒýÓÃ
Õâ¸öÎÊÌâÓÐʲôÒâÒ壿
É¢·ÖµÄÒâÒåµÄÓУ¡
¹þ¹þ£¬ ......
Ò»¸öͬѧ£¬¸Õ¸Õ´óѧ±ÏÒµ£¬µ½º¼ÖݵÄÒ»¼ÒÈÕÆó×öÍâ°ü£¬ÊÇÓõÄruby£¬ÔÂнһ¿ªÊ¼¾Í£¤8000ÁË£¬ÉÏÒ»Äêµ½ÄǵÄʦÐÖ¶¼ÉÏÍòÁË£¬ÎªÊ²Ã´×öphpÖ»ÓÐÄÇô2~3k£¿
ÒòΪ¶®rubyµÄÉÙ£¬ÎÒÃÇÕâ±ß»¹ÓÐ1.5WµÄÄØ
ÎïÒÔϡΪ¹ó
php,.net
ËÈ ......
1. ÀýÈçÔÚ
Person.rb ÖÐ
Python code:
class Person
def talk
puts "nihao"
end
end
Student.rb
Python code:
class Student < Person
def talk
puts &quo ......