Class: EagleCAD::Geometry::Circle
- Inherits:
-
Geometry::Circle
- Object
- Geometry::Circle
- EagleCAD::Geometry::Circle
- Defined in:
- lib/eaglecad/geometry.rb
Instance Attribute Summary collapse
-
#line_width ⇒ Object
Returns the value of attribute line_width.
Class Method Summary collapse
-
.from_xml(element) ⇒ Object
Create a Circle from an REXML::Element.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Circle
constructor
A new instance of Circle.
- #to_xml ⇒ REXML::Element
Constructor Details
#initialize(options = {}) ⇒ Circle
Returns a new instance of Circle.
18 19 20 21 |
# File 'lib/eaglecad/geometry.rb', line 18 def initialize(={}) @line_width = .delete(:line_width) super [:center], [:radius] end |
Instance Attribute Details
#line_width ⇒ Object
Returns the value of attribute line_width.
10 11 12 |
# File 'lib/eaglecad/geometry.rb', line 10 def line_width @line_width end |
Class Method Details
.from_xml(element) ⇒ Object
Create a EagleCAD::Geometry::Circle from an REXML::Element
14 15 16 |
# File 'lib/eaglecad/geometry.rb', line 14 def self.from_xml(element) self.new center:Geometry.point_from(element, 'x', 'y'), radius:element.attributes['radius'].to_f, line_width:element.attributes['width'].to_f end |