Class: EagleCAD::Geometry::Hole

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#drillObject

Returns the value of attribute drill

Returns:

  • (Object)

    the current value of drill



29
30
31
# File 'lib/eaglecad/geometry.rb', line 29

def drill
  @drill
end

#originObject

Returns the value of attribute origin

Returns:

  • (Object)

    the current value of origin



29
30
31
# File 'lib/eaglecad/geometry.rb', line 29

def origin
  @origin
end

Class Method Details

.from_xml(element) ⇒ Object



30
31
32
# File 'lib/eaglecad/geometry.rb', line 30

def self.from_xml(element)
		Geometry::Hole.new Geometry.point_from(element, 'x', 'y'), element.attributes['drill']
end

Instance Method Details

#to_xmlREXML::Element

Returns:

  • (REXML::Element)


35
36
37
# File 'lib/eaglecad/geometry.rb', line 35

def to_xml
		REXML::Element.new('hole').tap {|element| element.add_attributes({'x' => Geometry.format(origin.x), 'y' => Geometry.format(origin.y), 'drill' => drill}) }
end