Class: Moleculer::Support::OpenStruct

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/moleculer/support/open_struct.rb

Overview

An OpenStruct that supports camelized serialization for JSON

Instance Method Summary collapse

Instance Method Details

#to_hHash

Returns the object prepared for conversion to JSON for transmission.

Returns:

  • (Hash)

    the object prepared for conversion to JSON for transmission



10
11
12
# File 'lib/moleculer/support/open_struct.rb', line 10

def to_h
  Hash[super.map { |item| [StringUtil.camelize(item[0]), item[1]] }]
end