Class: EagleCAD::DeviceSet::Connect

Inherits:
Struct
  • Object
show all
Defined in:
lib/eaglecad/deviceset.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#gateObject

Returns the value of attribute gate

Returns:

  • (Object)

    the current value of gate



10
11
12
# File 'lib/eaglecad/deviceset.rb', line 10

def gate
  @gate
end

#padObject

Returns the value of attribute pad

Returns:

  • (Object)

    the current value of pad



10
11
12
# File 'lib/eaglecad/deviceset.rb', line 10

def pad
  @pad
end

#pinObject

Returns the value of attribute pin

Returns:

  • (Object)

    the current value of pin



10
11
12
# File 'lib/eaglecad/deviceset.rb', line 10

def pin
  @pin
end

#routeObject

Returns the value of attribute route

Returns:

  • (Object)

    the current value of route



10
11
12
# File 'lib/eaglecad/deviceset.rb', line 10

def route
  @route
end

Class Method Details

.from_xml(element) ⇒ Object



11
12
13
# File 'lib/eaglecad/deviceset.rb', line 11

def self.from_xml(element)
		Connect.new element.attributes['gate'], element.attributes['pin'], element.attributes['pad'], element.attributes['route']
end

Instance Method Details

#to_xmlREXML::Element

Returns:

  • (REXML::Element)


16
17
18
# File 'lib/eaglecad/deviceset.rb', line 16

def to_xml
		REXML::Element.new('connect').tap {|element| element.add_attributes({'gate' => gate, 'pad' => pad, 'pin' => pin}) }
end