Class: Set

Inherits:
Object show all
Defined in:
lib/psych/core_ext.rb

Instance Method Summary collapse

Instance Method Details

#encode_with(coder) ⇒ Object



23
24
25
26
27
28
29
30
# File 'lib/psych/core_ext.rb', line 23

def encode_with(coder)
  hash = {}
  each do |m|
    hash[m] = true
  end
  coder["hash"] = hash
  coder
end

#init_with(coder) ⇒ Object



32
33
34
# File 'lib/psych/core_ext.rb', line 32

def init_with(coder)
  replace(coder["hash"].keys)
end