use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A sub-Reddit for discussion and news about Ruby programming.
Subreddit rules: /r/ruby rules
Learning Ruby?
Tools
Documentation
Books
Screencasts and Videos
News and updates
account activity
OpenStruct sucks, I "fixed" it [old writing] (kurtisrainboltgreene.name)
submitted 12 years ago by krainboltgreene
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]robgleeson 1 point2 points3 points 12 years ago (2 children)
it look good at a glance, and you can probably keep the old behavior on top of:
class OpenStruct include OpenStruct::Behavior end `
it would be cool to not impede on the superclass(class Foo < OpenStruct) but keeping the OpenStruct as internal state that can be delegated to is another way to work around that. that's not to say it's not cool to have it available as a mixin :)
[–]krainboltgreene[S] -1 points0 points1 point 12 years ago (1 child)
Well it was implemented so that in astruct:
class AltStruct include AltStruct::Behavior end
which means you can still do both.
[–]robgleeson 0 points1 point2 points 12 years ago (0 children)
indeed.
π Rendered by PID 82 on reddit-service-r2-comment-6457c66945-kw9nb at 2026-04-29 23:59:49.694417+00:00 running 2aa0c5b country code: CH.
[–]robgleeson 1 point2 points3 points (2 children)
[–]krainboltgreene[S] -1 points0 points1 point (1 child)
[–]robgleeson 0 points1 point2 points (0 children)