Class: VORuby::STC::V1_10::Coords::DoubleArray
- Inherits:
-
TypedArray
- Object
- Array
- TypedArray
- VORuby::STC::V1_10::Coords::DoubleArray
- Includes:
- SerializableToXml
- Defined in:
- lib/voruby/stc/1.10/coords.rb
Overview
For vector coordinates we need arrays of doubles
Class Method Summary collapse
Instance Method Summary collapse
Methods included from SerializableToXml
Methods inherited from TypedArray
#<<, #[]=, #clear, #initialize, #insert, maximum_length, #replace, #to_s
Methods inherited from Array
Constructor Details
This class inherits a constructor from TypedArray
Class Method Details
.from_xml(xml) ⇒ Object
384 385 386 |
# File 'lib/voruby/stc/1.10/coords.rb', line 384 def self.from_xml(xml) self.new(element_from(xml).text.split(' ').collect{ |n| Float(n) }) end |
.restricted_to ⇒ Object
382 |
# File 'lib/voruby/stc/1.10/coords.rb', line 382 def self.restricted_to; [Float] end |
Instance Method Details
#to_xml(name = nil, ns = nil) ⇒ Object
388 389 390 391 392 393 |
# File 'lib/voruby/stc/1.10/coords.rb', line 388 def to_xml(name=nil, ns=nil) el = element(name, ns) el.text = self.to_s collapse_namespaces(el) el end |