Module: MarilynRPC::MailHelper
- Included in:
- CallRequestMail, CallResponseMail, ExceptionMail
- Defined in:
- lib/marilyn-rpc/mails.rb
Overview
Helper that gets mixed into the mail classes to make common things easyer
Class Method Summary (collapse)
-
+ (Object) type(nr)
generate a new serialize id which can be used in a mail.
Instance Method Summary (collapse)
-
- (Object) deserialize(data)
deserializes the passed data to the original objects.
-
- (String) only_data(data)
extracts the real data and ignores the type information.
-
- (Object) serialize(data)
serialize the data using marilyns default serializer.
Class Method Details
+ (Object) type(nr)
generate a new serialize id which can be used in a mail
7 8 9 |
# File 'lib/marilyn-rpc/mails.rb', line 7 def self.type(nr) [nr].pack("c") end |
Instance Method Details
- (Object) deserialize(data)
deserializes the passed data to the original objects
28 29 30 |
# File 'lib/marilyn-rpc/mails.rb', line 28 def deserialize(data) Marshal.load(data) end |
- (String) only_data(data)
extracts the real data and ignores the type information
14 15 16 |
# File 'lib/marilyn-rpc/mails.rb', line 14 def only_data(data) data.slice(1, data.size) end |
- (Object) serialize(data)
serialize the data using marilyns default serializer
21 22 23 |
# File 'lib/marilyn-rpc/mails.rb', line 21 def serialize(data) Marshal.dump(data) end |