S
Suraj Kurapati
Why isn't the Struct class smart enough to detect a question mark at the
end of a member name and create the appropriate #member= and #member?
methods?
=> Klass
=> nil
NoMethodError: undefined method `bar?' for #<struct Klass foo=nil,
:bar?=nil>
from (irb):5
from :0
I was expecting Klass to have the #foo, #foo=, #bar?, and #bar= methods.
end of a member name and create the appropriate #member= and #member?
methods?
=> Klass
=> nil
NoMethodError: undefined method `bar?' for #<struct Klass foo=nil,
:bar?=nil>
from (irb):5
from :0
I was expecting Klass to have the #foo, #foo=, #bar?, and #bar= methods.