RubyGems Navigation menu

base 0.0.1

People love Base classes! They have tons of methods waiting to be used. Just check out ActiveRecord::Base's method list: >> ActiveRecord::Base.methods.length => 530 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: class Cantaloupe < Base def embiggen encode64(deflate(SEPARATOR)) end end >> 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 will call it! By the way, remember those 530 ActiveRecord methods? That's amateur stuff. Check out Base loaded inside a Rails app: >> Base.new.methods.count => 6947 It's so badass that it takes FIVE SECONDS just to answer that question!

Gemfile:
= 复制到剪贴板 已复制!

安装:
=

版本列表:

  1. 0.0.2 - September 03, 2011 (6.5 KB)
  2. 0.0.1 - September 02, 2011 (6.5 KB)
显示所有版本 (共 3 个)

Development 依赖 (2):

hoe ~> 2.12
rspec >= 2.1.0

业主:

作者:

  • Gary Bernhardt

SHA 256 校验和:

37576a3d7f11bca6237b5f6c018466b71632996da3090caca4df31c1e7e60838

下载总量 11,127

这个版本 4,217

许可:

需要的 Ruby 版本:

链接: