Class: Task::TaskIDGenerator
- Inherits:
-
Object
- Object
- Task::TaskIDGenerator
- Defined in:
- lib/entity/task.rb
Overview
singleton class to serve as an id generator for Task.
Constant Summary collapse
- @@id =
Returns the current id.
0
Class Method Summary collapse
-
.generate_new_id ⇒ Fixnum
generates a new id and returns it.
Instance Method Summary collapse
-
#initialize(id) ⇒ TaskIDGenerator
constructor
initialization.
Constructor Details
#initialize(id) ⇒ TaskIDGenerator
initialization
87 88 89 |
# File 'lib/entity/task.rb', line 87 def initialize(id) @@id = id end |
Class Method Details
.generate_new_id ⇒ Fixnum
generates a new id and returns it
93 94 95 |
# File 'lib/entity/task.rb', line 93 def self.generate_new_id @@id += 1 end |