This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
commit 7a00e65ec33d6d65bdb8b7ae5901965d13abe29b
tree 0afbb6a3f2b921b67b2c99f7d3b26b1ccc99b151
parent 70ef615072b65344e7db35ec1c7ca3045ed484e0
tree 0afbb6a3f2b921b67b2c99f7d3b26b1ccc99b151
parent 70ef615072b65344e7db35ec1c7ca3045ed484e0
| name | age | message | |
|---|---|---|---|
| |
History.txt | Thu Mar 06 15:26:03 -0800 2008 | |
| |
Manifest.txt | Thu Mar 19 11:07:29 -0700 2009 | |
| |
README.txt | Wed Mar 05 22:19:55 -0800 2008 | |
| |
Rakefile | Wed Mar 04 12:15:09 -0800 2009 | |
| |
init.rb | Thu Mar 06 13:41:49 -0800 2008 | |
| |
install.rb | Thu Mar 06 13:41:49 -0800 2008 | |
| |
lib/ | Sun Oct 11 19:45:44 -0700 2009 | |
| |
object_proxy.gemspec | Sun Oct 11 19:48:10 -0700 2009 | |
| |
rails/ | Thu Mar 27 13:11:10 -0700 2008 | |
| |
test/ | Thu Mar 06 05:47:33 -0800 2008 |
README.txt
= ObjectProxy * http://github.com/JackDanger/object_proxy/tree/master == DESCRIPTION ObjectProxy provides a proxied interface to Ruby objects. It lets you add methods to objects that don't normally support them. == USAGE A simple extension to a fixnum: fixnum = ObjectProxy.new(1234) # => 1234 fixnum.proxy_class.class_eval do define_method :hi_there do 'Ahoy!' end end # => #<Proc:0x018f58f8> fixnum.size # => 4 fixnum.hi_there # => Ahoy! A more complex example where a string is able to update itself from a text file class FetchedString < ObjectProxy def initialize(target, filename) @target = target @filename = filename end def update @target = File.read(filename) end end # write a string into a file File.open('/tmp/greeting.txt', 'w') {|f| f.write('welcome')} string = FetchedString.new('hey there', '/tmp/greeting.txt') # => 'hey there' string.class # => String string.update # => 'welcome' == INSTALL: * sudo gem install object_proxy == LICENSE: (The MIT License) Copyright (c) 2008 FIX Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.







