Ok, I''ve just finished unit testing the new stuff, but I''m not
happy
with what had to change so it would be great to get some
feedback/advice...
So before we were trying to do this:
myevent.start = Date.today, {:TZID => "Europe/Copenhagen"}
but I realized that assignment methods in ruby aren''t like regular
methods, so you can''t have multiple assignment. It bundles everything
up and puts it into an array. At first I thought that would be ok, but
it means an array can''t be assigned as a property value because there
would be some ambiguity, so I changed it to this:
myevent.start = Date.today # Works like normal
myevent.start = {:value => Date.today, :TZID =>
"Europe/Copenhagen"}
What do you think? If anyone knows how to make the first version work
that would be great. (Maybe I should ask ruby-talk...?)
Then getters work like this:
date = myevent.start # Works like normal
date_hash = myevent.start(true) # Boolean says you want params also
So in the second version you get the full hash {:value =>
Date.today, :TZID => "Europe/Copenhagen"}. The problem with this
is
that it breaks the block type assignment which used the getter methods
as setters...
cal.event do
start Date.today
end
That would have to change to
cal.event do
start = Date.today
end
but ruby thinks its a local variable so the assignment method doesn''t
get called unless you do self.start = Date.today. Ideas?
-Jeff