Project

rrr

0.0
No commit activity in last 3 years
No release in over 3 years
A ruby library for Ruby programming with RR that allows method overload
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 2.1.2.3
>= 0.10.4
 Project Readme
RRR
===
A ruby library for Ruby programming with RR that allows method overload.


Methods
=======

This provides new 'cm' and 'im' class methods to Object class

* Object.cm(&block)
    adds class methods

* Object.im(&block)
    adds instance methods


Example
=======

  require 'rrr'

  class User < ActiveRecord::Base
    cm do
      by(numeric) {|id|   User.find(id) }
      by(string)  {|name| User.find_by_name(name) }
    end
  end

  User.by('x')  # => called User.find_by_name('x')
  User.by(1)    # => called User.find(1)
  User.by       # RR::Errors::DoubleNotFoundError


Copyright (c) 2009 maiha@wota.jp, released under the MIT license