Skip to content

Commit

Permalink
Support Marshal dump / load
Browse files Browse the repository at this point in the history
  • Loading branch information
joeldrapper committed Jan 22, 2023
1 parent dbe7343 commit d6cdd59
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,15 @@ def with(**kwargs)

private

def marshal_dump
@attributes
end

def marshal_load(object)
@attributes = object
freeze
end

def initialize_copy(source)
super.freeze
end
Expand Down

0 comments on commit d6cdd59

Please sign in to comment.