Sha256: d488b4120e04ceeaddb268d476a895441426985e94d4f59d5bfeb34da61d64d3
Contents?: true
Size: 894 Bytes
Versions: 26
Compression:
Stored size: 894 Bytes
Contents
module Foobara module TypeDeclarations module Attributes class << self def merge(*type_declarations) element_type_declarations = {} required = [] defaults = {} type_declarations.each do |declaration_data| element_type_declarations.merge!(declaration_data[:element_type_declarations]) type_defaults = declaration_data[:defaults] type_required = declaration_data[:required] if type_defaults && !type_defaults.empty? defaults.merge!(type_defaults) end if type_required && !type_required.empty? required += type_required end end { type: "::attributes", element_type_declarations:, required:, defaults: } end end end end end
Version data entries
26 entries across 26 versions & 1 rubygems