Class: GvIdMap
- Inherits:
-
Object
- Object
- GvIdMap
- Defined in:
- lib/yaml2erd/gv_id_map.rb
Instance Method Summary collapse
- #enc(model) ⇒ Object
-
#initialize ⇒ GvIdMap
constructor
A new instance of GvIdMap.
Constructor Details
#initialize ⇒ GvIdMap
Returns a new instance of GvIdMap.
2 3 4 5 |
# File 'lib/yaml2erd/gv_id_map.rb', line 2 def initialize @map = {} @cnt = 1 end |
Instance Method Details
#enc(model) ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/yaml2erd/gv_id_map.rb', line 7 def enc(model) model = model.to_sym if model.class == String if @map[model].nil? @map[model] = @cnt.to_s.to_sym @cnt += 1 end @map[model] end |