百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
B

base

> 编程语言
开源

你一直想要的通用基类。

446 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

你一直想要的通用基类。

Base

  • http://github.com/garybernhardt/base

DESCRIPTION:

People love Base classes! They have tons of methods waiting to be used. Just check out ActiveRecord::Base's method list:

irb
>> ActiveRecord::Base.methods.length
=> 572

But why stop there? Why not have even more methods? In fact, let's put every method on one Base class!

So I did. It's called Base. Just subclass it and feel free to directly reference any class method, instance method, or constant defined on any module or class in the system. Like this:

ruby
class Cantaloupe > Cantaloupe.new.embiggen
=> "eJzTBwAAMAAw\n"

See that embiggen method calling encode64 and deflate methods? Those come from the Base64 and Zlib modules. And the SEPARATOR constant is defined in File. Base don't care where it's defined! Base calls what it wants!

By the way, remember those 572 ActiveRecord methods? That's amateur stuff. Check out Base loaded inside a Rails app:

irb
>> Base.new.methods.count
=> 5794

It's so badass that it takes five seconds just to answer that question!

Base is just craaazzy! It's the most fearless class in all of Ruby. Base doesn't afraid of anything!

LICENSE:

Distributed under the union of the terms specified by all current OSI-approved licenses. In the event of a conflict, a die is to be rolled.

PRAISE FOR BASE

@garybernhardt @kantrn ... Can't tell if joke or just Ruby.

- @shazow

@garybernhardt y u troll soooo good? ;-)

- @amerine

@garybernhardt Imagine all the things you could have done doing not that

- @mrb_bk

@garybernhardt I hate you.

- @jmazzi

SHOULD I USE THIS IN MY SYSTEM?

Yes. I am being completely serious. You should.

Definitely.

Issues· 3 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Ruby

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言