Sha256: ee3bf75ff1bdb50dcd7ee773ff06fb8d14c944472f4fd1220f9a8672da010845
Contents?: true
Size: 809 Bytes
Versions: 57
Compression:
Stored size: 809 Bytes
Contents
require 'fiona7/json/obj_decorator' module Fiona7 module JSON class TypelessObjDecorator < ObjDecorator def as_json(*args) with_types = super() without_types = {} with_types.each do |attr, (value, type)| without_types[attr] = value end if without_types[:_widget_pool] && !without_types[:_widget_pool].empty? widgets_without_types = without_types[:_widget_pool].map do |id, values| values_without_types = {} values.each do |attr, (value, type)| values_without_types[attr] = value end [id, values_without_types] end without_types[:_widget_pool] = Hash[widgets_without_types] end without_types.as_json(*args) end end end end
Version data entries
57 entries across 57 versions & 1 rubygems