Module: Qwirk::MarshalStrategy::Ruby

Extended by:
Ruby
Included in:
Ruby
Defined in:
lib/qwirk/marshal_strategy/ruby.rb

Instance Method Summary collapse

Instance Method Details

#marshal(object) ⇒ Object



14
15
16
# File 'lib/qwirk/marshal_strategy/ruby.rb', line 14

def marshal(object)
  ::Marshal.dump(object)
end

#marshal_typeObject



6
7
8
# File 'lib/qwirk/marshal_strategy/ruby.rb', line 6

def marshal_type
  :bytes
end

#to_symObject



10
11
12
# File 'lib/qwirk/marshal_strategy/ruby.rb', line 10

def to_sym
  :ruby
end

#unmarshal(msg) ⇒ Object



18
19
20
21
# File 'lib/qwirk/marshal_strategy/ruby.rb', line 18

def unmarshal(msg)
  msg = ::String.from_java_bytes(msg) unless msg.kind_of?(::String)
  ::Marshal.load(msg)
end