Class: EagleCAD::Sheet::PinReference

Inherits:
Struct
  • Object
show all
Defined in:
lib/eaglecad/sheet.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



9
10
11
# File 'lib/eaglecad/sheet.rb', line 9

def gate
  @gate
end

#partObject

Returns the value of attribute part

Returns:

  • (Object)

    the current value of part



9
10
11
# File 'lib/eaglecad/sheet.rb', line 9

def part
  @part
end

#pinObject

Returns the value of attribute pin

Returns:

  • (Object)

    the current value of pin



9
10
11
# File 'lib/eaglecad/sheet.rb', line 9

def pin
  @pin
end

Class Method Details

.from_xml(element) ⇒ Object



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

def self.from_xml(element)
		Sheet::PinReference.new element.attributes['part'], element.attributes['gate'], element.attributes['pin']
end

Instance Method Details

#to_xmlObject



14
15
16
17
18
# File 'lib/eaglecad/sheet.rb', line 14

def to_xml
		REXML::Element.new('pinref').tap do |element|
 element.add_attributes('gate' => gate, 'part' => part, 'pin' => pin)
		end
end