Class: Transit::Marshaler::Json Private

Inherits:
BaseJson
  • Object
show all
Defined in:
lib/transit/marshaler/cruby/json.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Methods inherited from BaseJson

#default_opts, #emit_array_end, #emit_array_start, #emit_map_end, #emit_map_start, #emit_value, #flush, #initialize

Methods included from Base

#emit_array, #emit_boolean, #emit_double, #emit_encoded, #emit_int, #emit_nil, #emit_string, #emit_tagged_value, #escape, #find_handler, #marshal, #marshal_top, #parse_options, #verbose_handlers

Constructor Details

This class inherits a constructor from Transit::Marshaler::BaseJson

Instance Method Details

#emit_map(m, cache) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



69
70
71
72
73
74
75
76
77
# File 'lib/transit/marshaler/cruby/json.rb', line 69

def emit_map(m, cache)
  emit_array_start(-1)
  emit_value("^ ", false)
  m.each do |k,v|
    marshal(k, true, cache)
    marshal(v, false, cache)
  end
  emit_array_end
end