Sha256: d8360d6f975b3379b98cc57986ef24ddfb316840bd4b6b8757d803eb32c40143

Contents?: true

Size: 711 Bytes

Versions: 7

Compression:

Stored size: 711 Bytes

Contents

= thirty-thirty

the right hand of Marshall BraveStarr

Selectively marshal objects without the fancy ruby 1.9 marshalling:

  class Marshalled
    extend Thirtythirty
    
    marshalled_accessor :attr1, :attr2
    attr_accessor :transient_attr
  end

  original = Marshalled.new
  original.attr1 = "value1"
  original.transient_attr = "non-marshalled"
  
  marshalled = Marshal.dump(original)
  
  reloaded = Marshal.load(marshalled)
  
  reloaded.attr1          # => "value1"
  reloaded.transient_attr # => nil

Note: Custom marshalling will only be activated by calling one of the marshalling methods (marshal, marshalled_reader, marshalled_writer, marshalled_accessor), not by extending Thirtythirty alone.

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
thirtythirty-0.2.2 README.rdoc
thirtythirty-0.1.0 README.rdoc
thirtythirty-0.0.8 README.rdoc
thirtythirty-0.0.6 README.rdoc
thirtythirty-0.0.5 README.rdoc
thirtythirty-0.0.4 README.rdoc
thirtythirty-0.0.3 README.rdoc