Class: AIXM::Component::Geometry::Point

Inherits:
Object
  • Object
show all
Includes:
AIXM::Concerns::Association, AIXM::Concerns::XMLBuilder
Defined in:
lib/aixm/component/geometry/point.rb

Overview

Either an individual point or the starting point of a great circle line. Defined by #xy coordinates.

Cheat Sheet in Pseudo Code:

point = AIXM.point(
  xy: AIXM.xy
)

Direct Known Subclasses

Arc, Border

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from AIXM::Concerns::XMLBuilder

#build_fragment, #to_uid, #to_xml

Methods included from AIXM::Concerns::Memoize

included, method

Methods included from AIXM::Concerns::Association

included

Constructor Details

#initialize(xy:) ⇒ Point

See the cheat sheet for examples on how to create instances of this class.



34
35
36
# File 'lib/aixm/component/geometry/point.rb', line 34

def initialize(xy:)
  self.xy = xy
end

Instance Attribute Details

#xyAIXM::XY #xy=(value) ⇒ Object

(Starting) point

Overloads:



30
31
32
# File 'lib/aixm/component/geometry/point.rb', line 30

def xy
  @xy
end

Instance Method Details

#geometryAIXM::Component::Geometry

Returns geometry this segment belongs to.

Returns:



22
# File 'lib/aixm/component/geometry/point.rb', line 22

belongs_to :geometry, as: :segment

#inspectString

Returns:

  • (String)


39
40
41
# File 'lib/aixm/component/geometry/point.rb', line 39

def inspect
  %Q(#<#{self.class} xy="#{xy}">)
end