Class: Ruote::WfidGenerator
- Inherits:
-
Object
- Object
- Ruote::WfidGenerator
- Defined in:
- lib/ruote/id/wfid_generator.rb
Direct Known Subclasses
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(context) ⇒ WfidGenerator
constructor
A new instance of WfidGenerator.
Constructor Details
#initialize(context) ⇒ WfidGenerator
Returns a new instance of WfidGenerator.
30 31 32 33 34 35 36 37 |
# File 'lib/ruote/id/wfid_generator.rb', line 30 def initialize(context) @context = context @last = @context.storage.get('variables', 'last_wfid') || { 'type' => 'variables', '_id' => 'last_wfid', 'raw' => Time.now.utc.to_f } end |
Instance Method Details
#generate ⇒ Object
39 40 41 42 43 44 |
# File 'lib/ruote/id/wfid_generator.rb', line 39 def generate raw = get_raw "#{raw.strftime('%Y%m%d%H%M%S')}-#{raw.usec}" end |