Roxy – An Object Proxying Library for Ruby
When you want your objects to refer to / have associations with other objects, it can quickly become a complex procedure. Ryan Daigle to the rescue! Ryan has built Roxy, a "Ruby Proxy-Object Library." He's also put together an awesome blog post with the motivation for developing Roxy and some code examples showing how it works. Roxy gives you the ability to add some rather ActiveRecord-esque functionality to your classes and their instances.
Straight from the horse's mouth:
Roxy is a basic proxy library that lets you quickly create proxies between your ruby objects. Its syntax is loosely based on Association Extensions in ActiveRecord as that is a well-known use of proxies.
Still not convinced to jump straight over to Ryan's blog post? Code example coming up in 3..2..1..:
class Person include Roxy::Moxie attr_accessor :first, :last, :parents proxy :parents do def divorced? proxy_target.size > 1 and proxy_target.collect { |parent| parent.last }.uniq.size > 1 end end end # Can then invoke your proxy methods directly on parents person.parents.divorced?
Supported by: ActionGear is a menu-bar app for task management on your Mac. It's lightweight, quick, and helps you get stuff done. Try it out for free.
November 14, 2008 at 1:47 am
Hey Peter, great logo! Can I yank it and use it for Roxy?
November 14, 2008 at 1:53 am
Noooo.. in fact, I don't think I should even be using it at all and might remove it.
This is one of those cases where I've done a quick and nasty screenshot from a Google Image result just to get the job done. It turns out this logo belongs to a clothing manufacturer of some sort. While this usage isn't likely to hurt them, they might not be too keen on seeing it used as an actual logo.
That said, it's an awfully interesting logo because it /looks/ like a Ruby in there, but it's actually a tongue if you see the full thing (at least, I think so).
So, sorry, but it's not my logo to give away :(
November 14, 2008 at 10:39 am
I'm surprised to see a logo from a brand for surfing clothing for girls for a Ruby library ;-)
November 14, 2008 at 12:15 pm
Good to hear you're just as fly-by-the-seat-of-your-pants as I, Peter :)
And Martin - Roxy is a feminine name so the logo _kinda_ makes sense, yeah?
November 14, 2008 at 2:57 pm
Roxy is the female line of quiksilver clothing (surfing related clothing), that Ruby looking thing is two, mirrored quiksilver logos.
November 14, 2008 at 3:42 pm
Great bit of trivia, Jacob! That logo is pretty cool actually.
Since it seems to be associated with a big company and I don't fancy getting a C&D anytime soon, I've replaced it with something far worse but free of copyright issues ;-)
November 26, 2008 at 9:01 pm
That log is downright sexy, Peter.
November 26, 2008 at 9:02 pm
Crap. ^log^logo.
That LOGO is down right sexy.
How unfortunate.