def set_pin_name(node, name)

      return unless node.name == "pin"

      #Change the name of any pin-label "text attributes" that reference the given pin.
      original_name = get_pin_name(node)

      #Retrieve a collection of all attributes that match the pin's original name...
      pin_labels = @xml.css("symbol graph attrtext[attrname=\"PinName\"][type=\"pin #{original_name}\"]")

      #And modify them so they now match the new node's name.
      pin_labels.each { |pin| pin.attribute('type').value = "pin #{name}" }

      #Finally, set the name of the node itself.
      node.attribute("name").value = name
      
    end
def set_pin_name(node, name)

      return unless node.name == "pin"

      #Change the name of any pin-label "text attributes" that reference the given pin.
      original_name = get_pin_name(node)

      #Retrieve a collection of all attributes that match the pin's original name...
      pin_labels = @xml.css("symbol graph attrtext[attrname=\"PinName\"][type=\"pin #{original_name}\"]")

      #And modify them so they now match the new node's name.
      pin_labels.each { |pin| pin.attribute('type').value = "pin #{name}" }

      #Finally, set the name of the node itself.
      node.attribute("name").value = name
      
    end
def set_pin_name ( node , name ) return unless node . name == "pin" #Change the name of any pin-label "text attributes" that reference the given pin. original_name = get_pin_name ( node ) #Retrieve a collection of all attributes that match the pin's original name... pin_labels = @xml . css ( "symbol graph attrtext[attrname=\"PinName\"][type=\"pin #{original_name}\"]" ) #And modify them so they now match the new node's name. pin_labels . each { | pin | pin . attribute ( 'type' ) . value = "pin #{name}" } #Finally, set the name of the node itself. node . attribute ( "name" ) . value = name end
Sets name of the pin represented by the given node, updating all values
Sets name of the pin represented by the given node updating all values