###数据类型
- 5, 5.0, 1e3, 数组[] , 区间(1..3,1...3) to_a,字典{:a=>2}
- 没有元组
###表达式关键字
- if a then b else c
- a ? b:c
- for i in 1..10 [方法break , next & redo & retry]
- while end
- unless == if not
- until end
- case when end
- @ @@ $ ::
###函数()
- b = ->(a){print a} / b = proc{|x| print x} / lambda {|x| print x}
- def a(b=2); def a(*args);
###模块
###module m
- require / load 加载文件
- include / extend 加载模块
###类
class Person < Human
public :say
def initialize( name, age=18 )
end
attr_accessor :name
def say(@name)
end
end
- 对象Person.new()