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

http://ruby-doc.org/

ruby cookbook的更多相关文章

  1. 看过ruby相关书籍

    <ruby编程语言> <crafting rails applications> <agile web developemnt> <build awesome ...

  2. (转) [it-ebooks]电子书列表

    [it-ebooks]电子书列表   [2014]: Learning Objective-C by Developing iPhone Games || Leverage Xcode and Obj ...

  3. Enumerator yielder.yield 与 Proc.yield 区别

    最近看ruby cookbook遇到这个用法,google一下,这里原文解释 http://stackoverflow.com/questions/18865860/enumerator-yielde ...

  4. 3000本IT书籍下载地址

    http://www.shouce.ren/post/d/id/112300    黑客攻防实战入门与提高.pdfhttp://www.shouce.ren/post/d/id/112299    黑 ...

  5. 《RESTful Web APIs中文版》

    <RESTful Web APIs中文版> 基本信息 原书名:RESTful Web APIs 原出版社: O'Reilly Media 作者: Leonard Richardson    ...

  6. ruby 学习 -- string --1

    # define french_string = "il \xc3\xa9tait une fois" long_string = <<EOF Here is a lo ...

  7. 使用ArcGIS Chef Cookbook轻松搞掂WebGIS平台部署

    1.安装Chef Client v12版本. 2.复制arcgis cookbook资源到Chef安装目录. 3.考虑到一般部署的服务器环境无法连接互联网,所以需要事先部署ArcGIS Cookboo ...

  8. ruby on rails笔记

    一.新建rails项目步骤: 1.生成新项目 rails new demo cd demo vi Gemfile 末尾end前增加   gem 'execjs'   gem 'therubyracer ...

  9. 安装cocoapods遇到两大坑-Ruby版本升级和Podfile的配置

    今天安装cocoapods #移除原有ruby源 $ gem sources --remove https://rubygems.org/ #使用可用的淘宝网 $ gem sources -a htt ...

随机推荐

  1. 读书list

    1. TCP/IP 1.1 图解 TCP/IP 1.2 TCP/IP 详解 2. HTTP 2.1 HTTP 权威指南

  2. canvas-star6.html

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  3. html5标签css3的常用样式

    <meta name=''> name:有如下6个值:application-name:文档名或者应用名,整个文档只能包含一个值.author:文档作者description:文档描述ge ...

  4. 百度面试题:从输入url到显示网页,后台发生了什么?

    参考http://igoro.com/archive/what-really-happens-when-you-navigate-to-a-url/ http://www.cnblogs.com/we ...

  5. Android7.0 拨号盘应用源码分析(一) 界面浅析

    前言 android拨号盘的源码目录在package/app/Dialer 自7.0以后Incallui的源码直接放到了Dialer目录下,虽然在7.0以前incallui有自己独立的目录,但实际编译 ...

  6. flex的Cairngorm框架

    由于要写flex的项目,接触了一段时间的Cairngorm框架,初步认识它是flex的一个mvc结构的框架实现了页面,调用相应方法的控制,和后台交互之间的三层之间的联系.Cairngorm框架主要包括 ...

  7. SDUT 2772 数据结构实验之串一:KMP简单应用

    数据结构实验之串一:KMP简单应用 Time Limit: 1000MS Memory Limit: 65536KB Submit Statistic Problem Description 给定两个 ...

  8. Jquery获得服务器控件的方法

    由于ASP.NET网页运行后,服务器控件会随机生成客户端id,jquery获取时候不太好操作,google了下,总结有以下3种方法: 服务器控件代码: <asp:TextBox ID=" ...

  9. com组件 智能指针崩溃问题崩溃问题

    int main(){ CoInitialize(NULL); HRESULT hr; IWinHttpRequestPtr pHttpReq=NULL; pHttpReq.CreateInstanc ...

  10. Oracle 查询字段在什么表

    -- 查询字段在什么表 select * from all_tab_cols t where t.column_name='ABC'; -- 查询字段在什么表并且 判断是否是主键 select * f ...