module Gummi module Document module Attributes extend ActiveSupport::Concern module ClassMethods def mapping_for_attribute(attribute) if attribute.is_a? Virtus::Attribute::EmbeddedValue {properties: attribute.primitive.mapping} elsif attribute.is_a? Virtus::Attribute::Collection mapping_for_attribute(attribute.member_type) else attribute.mapping end end def mapping result = {} attribute_set.each do |attribute| result.merge!({ attribute.name => mapping_for_attribute(attribute)}) end result end end end end end