Class: Hydrochlorb::Serializer

Inherits:
Object
  • Object
show all
Defined in:
lib/hydrochlorb/serializer.rb

Class Method Summary collapse

Class Method Details

.serialize(obj, options = {}) ⇒ Object



5
6
7
8
9
10
# File 'lib/hydrochlorb/serializer.rb', line 5

def serialize(obj, options = {})
  indent = options[:indent]
  indent = 2 unless indent.is_a? Integer and indent >= 0

  dump(obj, nil, indent, 0)
end