English 中文(简体)
Braces: [Brackets], (Parentheses) &{Curlies} in Duncan & Railways
原标题:Braces: [Brackets], (Parentheses) & {Curlies} in Ruby & Rails

因此,Ruby对使用有时的薄膜(<>>)的宽松宽容,而不是要求使用,给我造成了混乱,因为Im试图学习铁路,以及何时/在何处使用,原因何在?

有时,参数或数值通过如下:(@user,@comment),而其他时间看来是[:user => comment],而其他则只是::action =>edit

www.un.org/Depts/DGACM/index_french.htm

这些规则是什么? 你们是否必须帮助你们记住?

问题回答

括号为:

a = 2 * (3 + 4)
b = (x==y) || (m==n)
Hash.new.send( []= , :a, :b)

Cur字面和区块(例如:

h = {1=>2, 2=>3}
h.each {|k,v| puts k+v}

薄膜(<>条/条码> 用于阵容、阵列索引和参赛,以及从散射中选取,例如:

arr = [1, 2, 3]
two = arr[1]
three = h[2]

为了混淆问题,只要是最后的论点,也就可把面字作为使用方法的论据,而无需治疗薄膜或母体。 此外,可在方括号内使用斜面字,以建立一个包含散面的单一项目阵列:

puts 1=>2, 3=>4 #=> 1234
[5=>6, 7=>8]    #=> [{5=>6, 7=>8}]

在怀疑时,总是使用母子把物品组起来,并用粗略的镜子包 wrap。





相关问题
Ruby parser in Java

The project I m doing is written in Java and parsers source code files. (Java src up to now). Now I d like to enable parsing Ruby code as well. Therefore I am looking for a parser in Java that parses ...

rails collection_select vs. select

collection_select and select Rails helpers: Which one should I use? I can t see a difference in both ways. Both helpers take a collection and generates options tags inside a select tag. Is there a ...

RubyCAS-Client question: Rails

I ve installed RubyCAS-Client version 2.1.0 as a plugin within a rails app. It s working, but I d like to remove the ?ticket= in the url. Is this possible?

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

multiple ruby extension modules under one directory

Can sources for discrete ruby extension modules live in the same directory, controlled by the same extconf.rb script? Background: I ve a project with two extension modules, foo.so and bar.so which ...

Text Editor for Ruby-on-Rails

guys which text editor is good for Rubyonrails? i m using Windows and i was using E-Texteditor but its not free n its expired now can anyone plese tell me any free texteditor? n which one is best an ...

热门标签