Class: Moleculer::Support::OpenStruct
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- Moleculer::Support::OpenStruct
- Defined in:
- lib/moleculer/support/open_struct.rb
Overview
An OpenStruct that supports camelized serialization for JSON
Instance Method Summary collapse
-
#to_h ⇒ Hash
The object prepared for conversion to JSON for transmission.
Instance Method Details
#to_h ⇒ Hash
Returns 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 |