class ObjectFramework::Persistence::Converter
Converts a field between domain values and independent storage values.
Public Class Methods
Source
# File lib/object_framework/persistence/mapping.rb, line 8 def initialize(dump: ->(value) { value }, load: ->(value) { value }) @dump, @load = dump, load freeze end
Public Instance Methods
Source
# File lib/object_framework/persistence/mapping.rb, line 13 def dump(value); @dump.call(value); end
Source
# File lib/object_framework/persistence/mapping.rb, line 14 def load(value); @load.call(value); end