Module: RubyCqrs::Data::Decodable

Included in:
RubyCqrs::Domain::AggregateRepository
Defined in:
lib/ruby_cqrs/data/serialization.rb

Instance Method Summary collapse

Instance Method Details

#try_decode(type_str, data) ⇒ Object



23
24
25
26
27
# File 'lib/ruby_cqrs/data/serialization.rb', line 23

def try_decode type_str, data
  obj_type = type_str.constantize
  raise ObjectNotDecodableError unless obj_type.include? Beefcake::Message
  obj_type.decode data
end