Class: AIXM::Component::Geometry::Circle
- Defined in:
- lib/aixm/component/geometry/circle.rb
Overview
Circles are defined by a #center_xy and a #radius.
Cheat Sheet in Pseudo Code:
circle = AIXM.circle(
center_xy: AIXM.xy
radius: AIXM.d
)
Instance Attribute Summary collapse
-
#center_xy ⇒ Object
Center point.
-
#radius ⇒ Object
Circle radius.
Instance Method Summary collapse
-
#geometry ⇒ AIXM::Component::Geometry
Geometry this segment belongs to.
-
#initialize(center_xy:, radius:) ⇒ Circle
constructor
See the cheat sheet for examples on how to create instances of this class.
- #inspect ⇒ String
Methods included from AIXM::Concerns::XMLBuilder
#build_fragment, #to_uid, #to_xml
Methods included from AIXM::Concerns::Memoize
Methods included from AIXM::Concerns::Association
Constructor Details
#initialize(center_xy:, radius:) ⇒ Circle
See the cheat sheet for examples on how to create instances of this class.
42 43 44 |
# File 'lib/aixm/component/geometry/circle.rb', line 42 def initialize(center_xy:, radius:) self.center_xy, self.radius = center_xy, radius end |
Instance Attribute Details
Instance Method Details
#geometry ⇒ AIXM::Component::Geometry
Returns geometry this segment belongs to.
22 |
# File 'lib/aixm/component/geometry/circle.rb', line 22 belongs_to :geometry, as: :segment |
#inspect ⇒ String
47 48 49 |
# File 'lib/aixm/component/geometry/circle.rb', line 47 def inspect %Q(#<#{self.class} center_xy="#{center_xy}" radius="#{radius.to_s}">) end |