Class: VORuby::STC::V1_30::CustomRefPosType

Inherits:
ReferencePositionType show all
Defined in:
lib/voruby/stc/1.30/stc.rb

Overview

Type for custom positions: specifies reference origin.

Direct Known Subclasses

CoordRefPos

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from SerializableToXml

#element

Constructor Details

#initialize(coordinate) ⇒ CustomRefPosType

Returns a new instance of CustomRefPosType.



7261
7262
7263
# File 'lib/voruby/stc/1.30/stc.rb', line 7261

def initialize(coordinate)
  self.coordinate = coordinate
end

Instance Attribute Details

#coordinateObject

Returns the value of attribute coordinate.



7259
7260
7261
# File 'lib/voruby/stc/1.30/stc.rb', line 7259

def coordinate
  @coordinate
end

Class Method Details

.from_xml(xml) ⇒ Object



7284
7285
7286
7287
# File 'lib/voruby/stc/1.30/stc.rb', line 7284

def self.from_xml(xml)
  root = element_from(xml)
  self.new(xml_to_obj(root, Coordinate, true))
end

Instance Method Details

#==(r) ⇒ Object



7271
7272
7273
# File 'lib/voruby/stc/1.30/stc.rb', line 7271

def ==(r)
  self.coordinate == r.coordinate
end

#to_xml(name = nil) ⇒ Object



7275
7276
7277
7278
7279
7280
7281
7282
# File 'lib/voruby/stc/1.30/stc.rb', line 7275

def to_xml(name=nil)
  el = element(name)
  
  el.add_element(self.coordinate.to_xml)
  
  collapse_namespaces(el)
  el
end