• [翻译] 理解 Ruby 中的改良和词法作用域

    本文翻译自 Starr Horne 发表在 Honeybadger 上的文章:Understanding Ruby Refinements and Lexical Scope

    2015-12-24 #Ruby #Lexical Scope #Refinement
  • [翻译] Ruby 元编程:都是 Self 的事

    本文翻译自 Yehuda Katz 的博客文章 Metaprogramming in Ruby: It’s All About the Self

    2015-12-24 #Ruby #Meta Programming
  • [翻译] 词法作用域和 Ruby 中的类变量

    本文翻译自 Starr Horne 发表在 Honeybadger 上的文章:Lexical scoping and Ruby class variables

    2015-12-24 #Ruby #Scope #Lexical Scope
  • [翻译] 理解 Ruby 中的作用域

    本文翻译自 Darko Gjorgjievski 发表在 sitepoint 上的文章 Understanding Scope in Ruby

    2015-12-23 #Ruby #Scope
  • Git fetch, pull, checkout 和 push 简介

    git fetch 获取远程仓库更新到本地仓库

    2014-02-26 #Git
  • Ruby 中的循环控制语句

    Ruby 中常用到的循环控制语句包括:next、break、redo、retry 四种,下面就详细看看使用情景:

    2014-01-14 #Ruby #Syntax
  • Ruby 中的循环语句

    由于 Ruby 提供了很多便捷的方法进行对象的循环遍历,如:Array#each、Integer#times、Integer#downto、Integer#upto、Kernel#loop 等,所以日常的开发中很少会需要写循环语句。便整理了相关内容,方便日后查看参考。

    2014-01-13 #Ruby #Syntax
  • Ruby 中的 Shallow copy 和 Deep copy

    什么是 Shallow copy?

    2013-10-16 #Ruby
  • Ruby 中的 dup 和 clone

    前段时间项目中有个地方需要在 ActiveRecord 对象被删除后继续使用对象的一些属性进行些操作,很自然想到了在删除前把对象复制一份(删除说明:AR 对象调用 destroy 方法删除对象时,也只是删除了数据库中的记录,实际上该对象还是存在的,不过已经变为了 frozen 的状态),然后就接触到了 dup 和 clone 方法,看了文档后感觉二者还是比较容易搞混淆,结合一些搜索到的资料便做个记录。

    2013-10-12 #Ruby