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 ...
随机推荐
- Hive基础之HiveServer2 JDBC的使用
启动HiveServer2: cd $HIVE_HOME/bin 以后台方式默认端口启动HiveServer2(默认端口是10000):hiveserver2 & 以后台方式指定端口的方式启动 ...
- Rehat 5.8下oracle11g安装
Oracle 11g Redhat 5安装 一.检查硬件是否满足要求 检查一内存 On Linux x86: At least 1 GB of RAM 内存至少1G To determine the ...
- 1314: ZZY的困惑
1314: ZZY的困惑 Time Limit: 2 Sec Memory Limit: 128 M[Submit][Status][Web Board] Description ZZY有很多爱好~ ...
- mysq 因断电而导致的错误
问题来源: 昨天断电,而我没有保存,导致出现以下问题: 2015-10-12 10:48:10 7300 [Note] Plugin 'FEDERATED' is disabled. 2015-10- ...
- Android开发中,那些让你相见恨晚的方法、类或接口
1.getParent().requestDisallowInterceptTouchEvent(true);剥夺父view 对touch 事件的处理权,谁用谁知道. 2.ArgbEvaluator. ...
- [ CodeVS冲杯之路 ] P1053
不充钱,你怎么AC? 题目:http://codevs.cn/problem/1053/ 直接扫一遍串,把字母对应的 ascii 码直接做数组下标,交给数组统计 最后查询一遍数组的 'a'-'z' , ...
- VS2015+win10+opencv3.0整个安装过程
LZ最近换了台新台式电脑,开始下载新VS软件,话说软件平台越新越好用,一看网上已经有VS2015版本,果断就去官网下载. 1.安装VS操作 官方网的链接如下:https://www.visualstu ...
- 纯CSS最小响应网格布局
lemonade.css是一个超级小的CSS可以帮助你创建一个完全响应和灵活自如的网格布局,包括所需网页的头部. 样式链接 <link rel= href=> HTML结构这样创建一个多列 ...
- linux 系统启动流程
原著资料网址:http://wenku.baidu.com/view/414127fdf705cc1755270997.html (版权归原作者所有) Linux系统的启动分5个阶段,每个阶段都完成不 ...
- Stay Hungry
保持饥饿,从身体上来说,可以随时保持机动状态,所以,今天的早饭.午饭.晚饭,我都没有吃到饱.等到想要放松的时候,就饱餐一顿,未必不是一种幸福!精神上,保持饥饿,我还不清楚是一种什么样的状态,自然也描述 ...