ruby cookbook
11.2 listing object’s method
Oject.methods/singleton_methods/instance_methods
指定类名定义的方法在 singleton_methods
MyClass.method_defined? :my_instance_method
MyClass.respond_to? :my_singleton_method
for ..do/end 不是方法 不创建新的作用域 ,内部创建的变量,如同在外面创建一样
$var 全局变量
a =‘abc’
a<<’,tes’不创建新字符串
bock作参数 用&
def take_block(&block)
block.call
end
take_block do
puts "Block being called in the method!"
end
begin/rescue/end
ruby cookbook的更多相关文章
- 看过ruby相关书籍
<ruby编程语言> <crafting rails applications> <agile web developemnt> <build awesome ...
- (转) [it-ebooks]电子书列表
[it-ebooks]电子书列表 [2014]: Learning Objective-C by Developing iPhone Games || Leverage Xcode and Obj ...
- Enumerator yielder.yield 与 Proc.yield 区别
最近看ruby cookbook遇到这个用法,google一下,这里原文解释 http://stackoverflow.com/questions/18865860/enumerator-yielde ...
- 3000本IT书籍下载地址
http://www.shouce.ren/post/d/id/112300 黑客攻防实战入门与提高.pdfhttp://www.shouce.ren/post/d/id/112299 黑 ...
- 《RESTful Web APIs中文版》
<RESTful Web APIs中文版> 基本信息 原书名:RESTful Web APIs 原出版社: O'Reilly Media 作者: Leonard Richardson ...
- ruby 学习 -- string --1
# define french_string = "il \xc3\xa9tait une fois" long_string = <<EOF Here is a lo ...
- 使用ArcGIS Chef Cookbook轻松搞掂WebGIS平台部署
1.安装Chef Client v12版本. 2.复制arcgis cookbook资源到Chef安装目录. 3.考虑到一般部署的服务器环境无法连接互联网,所以需要事先部署ArcGIS Cookboo ...
- ruby on rails笔记
一.新建rails项目步骤: 1.生成新项目 rails new demo cd demo vi Gemfile 末尾end前增加 gem 'execjs' gem 'therubyracer ...
- 安装cocoapods遇到两大坑-Ruby版本升级和Podfile的配置
今天安装cocoapods #移除原有ruby源 $ gem sources --remove https://rubygems.org/ #使用可用的淘宝网 $ gem sources -a htt ...
随机推荐
- 《Code Complete》ch.16 控制循环
WHAT? 反复执行的代码片段(你是第一天学编程吗) WHY? 知道如何使用及何时使用每一种循环是创建高质量软件的一个决定性因素 HOW? 检测位于循环开始/循环结尾 带退出的循环 进入循环 只从一个 ...
- HDU 4770 Lights Against Dudely
Lights Against Dudely Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Ot ...
- Android开发-API指南-<service>
<service> 英文原文:http://developer.android.com/guide/topics/manifest/service-element.html 采集(更新)日 ...
- oracle数据库中的表设置主键自增
oracle中没有自增字段,可通过序列+触发器间接实现,cmd中sqlplus登录,直接运行即可.一般要经过一下几步: 1建立数据表 create table Test_Increase( ...
- php array(object) 与xml相互转换
private function _array_to_xml($source, $charset='utf-8'){ $array = json_decode($source); $pre = '&l ...
- SVN与TortoiseSVN实战:冲突详解(二)
硬广:<SVN与TortoiseSVN实战>系列已经写了四篇,第二篇<SVN与TortoiseSVN实战:标签与分支>和第三篇<SVN与TortoiseSVN实战:Tor ...
- RGB颜色空间与YCbCr颜色空间的互转
在人脸检测中会用到YCbCr颜色空间,因此就要进行RGB与YCbCr颜色空间的转换.在下面的公式中RGB和YCbCr各分量的值的范围均为0-255. RGB转到YCbCr: float y= (col ...
- EasyUI datagrid 复杂表头处理
1:表头固定(前台写) 参照官方:http://www.jeasyui.net/demo/334.html 效果图: 源代码如下: <!DOCTYPE html> <html> ...
- linux下proc目录详解
proc/pid记录了什么cd /proc/之后,你会发现很多的目录和文件,今天首先来介绍的就是那些以数字命名的目录--它们就是linux中的进程号,每当你创建一个进程时,里面就会动态更新多出一个名称 ...
- Query for Component Path within PeopleSoft Portal
1) Run the below SQL to get the content reference name for your component ;-- Replace :1 with the c ...