Class: VORuby::STC::V1_30::SmallCircleType

Inherits:
Object
  • Object
show all
Includes:
SerializableToXml
Defined in:
lib/voruby/stc/1.30/stc.rb

Overview

SmallCircleType is used in vertices to indicate that the polygon side associated with a vertex and its predecessor is to be a small circle rather than the default great circle.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from SerializableToXml

#element

Constructor Details

#initialize(pole = nil) ⇒ SmallCircleType

Returns a new instance of SmallCircleType.



5443
5444
5445
# File 'lib/voruby/stc/1.30/stc.rb', line 5443

def initialize(pole=nil)
  self.pole = pole
end

Instance Attribute Details

#poleObject

Returns the value of attribute pole.



5441
5442
5443
# File 'lib/voruby/stc/1.30/stc.rb', line 5441

def pole
  @pole
end

Class Method Details

.from_xml(xml) ⇒ Object



5464
5465
5466
5467
5468
5469
# File 'lib/voruby/stc/1.30/stc.rb', line 5464

def self.from_xml(xml)
  root = element_from(xml)
  
  pole = REXML::XPath.first(root, 'x:Pole', {'x' => obj_ns.uri})
  self.new(pole ? Double2Type.from_xml(pole) : nil)
end

Instance Method Details

#==(c) ⇒ Object



5452
5453
5454
# File 'lib/voruby/stc/1.30/stc.rb', line 5452

def ==(c)
  self.pole == c.pole
end

#to_xml(name = nil) ⇒ Object



5456
5457
5458
5459
5460
5461
5462
# File 'lib/voruby/stc/1.30/stc.rb', line 5456

def to_xml(name=nil)
  el = element(name)
  el.add_element(self.pole.to_xml('Pole')) if self.pole
  
  collapse_namespaces(el)
  el
end