
ruby language
文章平均质量分 70
lfx_cool
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
ruby method and block
Method parameters are considered to be variables local to that method. Block parameters are assigned values when the block is invoked.原创 2009-11-05 20:36:34 · 123 阅读 · 0 评论 -
proc and lambda
A return from inside a block that’s still in scope acts as a return from that scope. A return from a block whose original context is not longer valid raises an exception (LocalJumpError or ThreadE...原创 2009-11-06 11:18:32 · 150 阅读 · 0 评论 -
include and extend
Correct Understand: "extend" adds methods from a module into a class as class methods. "include" adds methods from a module into a class as instance methods. It is quite easy to demonstrate thi...原创 2009-08-05 18:04:02 · 105 阅读 · 0 评论 -
class<<self
问: Hi I have code like class A class原创 2009-08-05 18:25:52 · 131 阅读 · 0 评论 -
include and require
The "include" statement is for including a module into a class: 1. module Bar 2. end 3. 4. class Foo 5. include Bar 6. end The "require" statement loads a ruby file. ...原创 2009-08-05 19:00:33 · 138 阅读 · 0 评论 -
*, & 参数前缀
we specified the arguments as *args, meaning “collect the actual parameters passed to the method into an array named args.” 比如: def some_method(arg1, arg2, *args) ... end 调用some_method(1,2,3,4...原创 2009-08-11 14:07:04 · 128 阅读 · 0 评论