Class: EagleCAD::DeviceSet::Gate
- Inherits:
-
Struct
- Object
- Struct
- EagleCAD::DeviceSet::Gate
- Defined in:
- lib/eaglecad/deviceset.rb
Instance Attribute Summary collapse
-
#addlevel ⇒ Object
Returns the value of attribute addlevel.
-
#name ⇒ Object
Returns the value of attribute name.
-
#origin ⇒ Object
Returns the value of attribute origin.
-
#swaplevel ⇒ Object
Returns the value of attribute swaplevel.
-
#symbol ⇒ Object
Returns the value of attribute symbol.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#addlevel ⇒ Object
Returns the value of attribute addlevel
61 62 63 |
# File 'lib/eaglecad/deviceset.rb', line 61 def addlevel @addlevel end |
#name ⇒ Object
Returns the value of attribute name
61 62 63 |
# File 'lib/eaglecad/deviceset.rb', line 61 def name @name end |
#origin ⇒ Object
Returns the value of attribute origin
61 62 63 |
# File 'lib/eaglecad/deviceset.rb', line 61 def origin @origin end |
#swaplevel ⇒ Object
Returns the value of attribute swaplevel
61 62 63 |
# File 'lib/eaglecad/deviceset.rb', line 61 def swaplevel @swaplevel end |
#symbol ⇒ Object
Returns the value of attribute symbol
61 62 63 |
# File 'lib/eaglecad/deviceset.rb', line 61 def symbol @symbol end |
Class Method Details
.from_xml(element) ⇒ Object
62 63 64 |
# File 'lib/eaglecad/deviceset.rb', line 62 def self.from_xml(element) Gate.new element.attributes['name'], element.attributes['symbol'], Geometry.point_from(element, 'x', 'y'), element.attributes['addlevel'], element.attributes['swaplevel'] end |
Instance Method Details
#to_xml ⇒ REXML::Element
67 68 69 |
# File 'lib/eaglecad/deviceset.rb', line 67 def to_xml REXML::Element.new('gate').tap {|element| element.add_attributes({'name' => name, 'symbol' => symbol, 'x' => origin.x, 'y' => origin.y, 'addlevel' => addlevel, 'swaplevel' => swaplevel}) } end |