Skip to content

Commit

Permalink
🚧 SequenceSet YAML codec
Browse files Browse the repository at this point in the history
  • Loading branch information
nevans committed Nov 8, 2024
1 parent ea47e34 commit eaed8fe
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/net/imap/sequence_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1262,6 +1262,18 @@ def input_to_tuple(obj)
end
end

# For YAML serialization
def encode_with(coder) # :nodoc:
# we can reconstruct from the string
coder['atom'] = to_s
end

# For YAML deserialization
def init_with(coder) # :nodoc:
@tuples = []
self.atom = coder['atom']
end

def input_to_tuples(obj)
obj = input_try_convert obj
case obj
Expand Down

0 comments on commit eaed8fe

Please sign in to comment.