Class: VORuby::STC::V1_10::Region::SmallCircle
- Inherits:
-
Object
- Object
- VORuby::STC::V1_10::Region::SmallCircle
- Includes:
- SerializableToXml
- Defined in:
- lib/voruby/stc/1.10/region.rb
Overview
SmallCircle is used in vertices to indicate that the polygon side associated with the vertex is to be a small circle rather than the default great circle. SmallCircle indicates in polygons that side is along small circle; with optional pole.
Instance Attribute Summary collapse
-
#pole ⇒ Object
Returns the value of attribute pole.
Class Method Summary collapse
Instance Method Summary collapse
- #==(c) ⇒ Object
-
#initialize(options = {}) ⇒ SmallCircle
constructor
A new instance of SmallCircle.
- #to_xml(name = nil) ⇒ Object
Methods included from SerializableToXml
Constructor Details
#initialize(options = {}) ⇒ SmallCircle
Returns a new instance of SmallCircle.
290 291 292 |
# File 'lib/voruby/stc/1.10/region.rb', line 290 def initialize(={}) .is_a?(Hash) ? .each { |key, value| send("#{key}=", value) } : self.pole = end |
Instance Attribute Details
#pole ⇒ Object
Returns the value of attribute pole.
288 289 290 |
# File 'lib/voruby/stc/1.10/region.rb', line 288 def pole @pole end |
Class Method Details
.from_xml(xml) ⇒ Object
314 315 316 317 318 319 320 321 322 |
# File 'lib/voruby/stc/1.10/region.rb', line 314 def self.from_xml(xml) root = element_from(xml) = {} pole = REXML::XPath.first(root, 'x:Pole', {'x' => obj_ns.uri}) [:pole] = Double2.from_xml(pole) if pole SmallCircle.new() end |
Instance Method Details
#==(c) ⇒ Object
300 301 302 |
# File 'lib/voruby/stc/1.10/region.rb', line 300 def ==(c) self.pole == c.pole end |
#to_xml(name = nil) ⇒ Object
304 305 306 307 308 309 310 311 312 |
# File 'lib/voruby/stc/1.10/region.rb', line 304 def to_xml(name=nil) el = element(name) el.add_element(self.pole.to_xml('Pole', obj_ns)) if pole collapse_namespaces(el) el end |