没有合适的资源?快使用搜索试试~ 我知道了~
bottomless_hash:无底哈希Ruby宝石
共16个文件
rb:5个
md:2个
gitignore:1个
需积分: 5 0 下载量 29 浏览量
2021-05-03
13:58:17
上传
评论
收藏 8KB ZIP 举报
温馨提示
无底哈希 BottomlessHash是子类或Ruby Hash,允许您盲目分配值,而不会因缺少键而引起错误。 因此,您无需检查或使用.try.try.try...即可进行链式链接和访问密钥。 params = BottomlessHash . new params [ :world ] [ :thailand ] [ :bangkok ] [ :bangna ] params => { :world => { :thailand => { :bangkok => { :bangna => { } } } } } params [ :missing ] [ :key ] => { } # no error raised 警告 如果没有值,它将返回一个空哈希,而不是nil 。 记在脑子里: BottomlessHash . new [ :missing ] [ :key ] => {
资源推荐
资源详情
资源评论
收起资源包目录
bottomless_hash-master.zip (16个子文件)
bottomless_hash-master
.travis.yml 76B
bin
console 340B
setup 115B
bottomless_hash.gemspec 1KB
Rakefile 117B
Gemfile 100B
.rspec 31B
spec
hash_spec.rb 582B
bottomless_hash_spec.rb 1KB
spec_helper.rb 85B
.gitignore 87B
lib
bottomless_hash
version.rb 52B
bottomless_hash.rb 263B
CODE_OF_CONDUCT.md 1KB
README.md 1KB
LICENSE.txt 1KB
共 16 条
- 1
资源评论
80seconds
- 粉丝: 44
- 资源: 4568
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功