Class: Renum::IndexSerializer
- Inherits:
-
Object
- Object
- Renum::IndexSerializer
- Defined in:
- lib/renum/index_serializer.rb
Instance Method Summary collapse
- #dump(v) ⇒ Object
-
#initialize(enum_class) ⇒ IndexSerializer
constructor
A new instance of IndexSerializer.
- #load(i) ⇒ Object
Constructor Details
#initialize(enum_class) ⇒ IndexSerializer
Returns a new instance of IndexSerializer.
3 4 5 |
# File 'lib/renum/index_serializer.rb', line 3 def initialize enum_class @enum_class = enum_class end |
Instance Method Details
#dump(v) ⇒ Object
7 8 9 |
# File 'lib/renum/index_serializer.rb', line 7 def dump v v && v.index end |
#load(i) ⇒ Object
11 12 13 |
# File 'lib/renum/index_serializer.rb', line 11 def load i i && @enum_class[i] end |