demo:
class A
end
t = :name
if t.is_a?(Symbol) # true
puts 't true'
end
if A.is_a?(Symbol) # false
puts 'A true'
end
if 12.is_a?(Integer) #true
puts '12'
endref:
http://www.ruby-doc.org/core/classes/Symbol.html
http://www.ruby-doc.org/docs/Tutorial/part_01/objects.html
posted on 2009-07-14 11:53
fl1429 阅读(1177)
评论(0) 编辑 收藏 所属分类:
Rails