to_args

in lib/primer/view_components/linters/argument_mappers/base.rb [26:46]


        def to_args
          args = {}

          args[:tag] = ":#{@tag.name}" unless self.class::DEFAULT_TAG.nil? || @tag.name == self.class::DEFAULT_TAG

          @tag.attributes.each do |attribute|
            attr_name = attribute.name

            if self.class::ATTRIBUTES.include?(attr_name)
              args.merge!(attribute_to_args(attribute))
            elsif attr_name == "class"
              args.merge!(map_classes(attribute))
            else
              
              args.merge!(SystemArguments.new(attribute).to_args)
            end
          end

          args
        end