RUBY Persistence question
Posted: Wed Jul 17, 2013 7:31 am
Reading the manual it states:
It then goes on to mention 'User State Management'
This is an intriguing concept that I've just read, and makes me think of some use possibilities.
My question ... COULD this concept be utilized to provide a basis to implement a 'Trial Period' for a demo ???
With maybe some 'Total' number of runs ... or a Date the application is first launched, with a way to have an incremented counter that would trigger after so many weeks [for example].
Just reading this and thinking out loud. Is this a possibility? Has anyone tried something like this ?
Please ... no politics or moral judgments !!! I'm looking at concepts.
Thanks.
Persistence
The Ruby component saves its state. If you save a schematic with a Ruby component in it then when
you load it back the @ins and @outs arrays are restored to exactly how they were before. This
ensures that the component maintains its state at all times.
It then goes on to mention 'User State Management'
User State Management
If you have your own data that you want to save with a Ruby component then you can implement the
saveState and loadState methods:
def loadState v
end
def saveState
end
The way this works is really simple. In the saveState method you return a Ruby object that
encapsulates all the data that you want to save. It could be a string or an array say if you have lots of
data or it could just be a simple value.
This is an intriguing concept that I've just read, and makes me think of some use possibilities.
My question ... COULD this concept be utilized to provide a basis to implement a 'Trial Period' for a demo ???
With maybe some 'Total' number of runs ... or a Date the application is first launched, with a way to have an incremented counter that would trigger after so many weeks [for example].
Just reading this and thinking out loud. Is this a possibility? Has anyone tried something like this ?
Please ... no politics or moral judgments !!! I'm looking at concepts.
Thanks.