Mailinglist Archive: yast-devel (126 mails)

< Previous Next >
[yast-devel] on storing values in module namespace
  • From: Martin Kudlvasr <mkudlvasr@xxxxxxx>
  • Date: Mon, 2 Nov 2009 19:22:16 +0100
  • Message-id: <200911021922.16877.mkudlvasr@xxxxxxx>
Hi,

Josef inspired me to do some research in $SUBJ. The results are in new branch
of webclient called module-storage.
Just pull this branch, switch to it a reload /eulas a few times. I was too
lazy to create a special controller for this, so the counter is displayed
under the sign "All licenses have already been accepted" ;-)
The code itself is located in files:
/web-client/plugins/eulas/app/models/{module_storage,counter,counter_store}.rb

The code is very short and there are even some comments.

Caveeats found in the process:
- module, where the values are stored must not be in the same file as the
model. Model file get reloaded on every request.
- when using custom setters and getters, you have to explicitly type "self.".
Otherwise ruby thinks it is just a local variable.

Enjoy!

Martin
--
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-devel+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages