[Facebooker-talk] view problem
Mike Mangino
mmangino at elevatedrails.com
Fri Jan 23 18:33:32 EST 2009
I think that makes sense. I've added you as a committer to the
project. Feel free to commit a patch with tests!
Mike
On Jan 23, 2009, at 6:06 PM, kevin lochner wrote:
> How about setting to nil if value isn't a hash. The object is
> hash_settable, and it doesn't
> seem to make sense to assign it an object of arbitrary class
> (string) if it's not given a hash
> from which to populate:
>
> def hash_settable_writer(symbol, klass)
> define_method("#{symbol}=") do |value|
> instance_variable_set("@#{symbol}", value.kind_of?(Hash) ?
> klass.from_hash(value) : nil)
> end
> end
>
> On Jan 23, 2009, at 5:52 PM, kevin lochner wrote:
>
>> def hash_settable_writer(symbol, klass)
>> define_method("#{symbol}=") do |value|
>> instance_variable_set("@#{symbol}", value.kind_of?(Hash) ?
>> klass.from_hash(value) : value)
>> end
>> end
>
--
Mike Mangino
http://www.elevatedrails.com
More information about the Facebooker-talk
mailing list