Class: VORuby::STC::V1_10::STC::PositionIntervalType
- Inherits:
-
SpatialIntervalType
- Object
- SpatialIntervalType
- VORuby::STC::V1_10::STC::PositionIntervalType
- Defined in:
- lib/voruby/stc/1.10/stc.rb
Overview
Contains a spatial position CoordInterval
Direct Known Subclasses
Instance Attribute Summary collapse
-
#coord_interval ⇒ Object
Returns the value of attribute coord_interval.
-
#unit ⇒ Object
Returns the value of attribute unit.
Class Method Summary collapse
Instance Method Summary collapse
- #==(i) ⇒ Object
-
#initialize(options = {}) ⇒ PositionIntervalType
constructor
A new instance of PositionIntervalType.
- #to_xml(name = nil) ⇒ Object
Methods included from SerializableToXml
Constructor Details
#initialize(options = {}) ⇒ PositionIntervalType
Returns a new instance of PositionIntervalType.
2185 2186 2187 2188 2189 |
# File 'lib/voruby/stc/1.10/stc.rb', line 2185 def initialize(={}) raise_argument_required_error('coordinate interval') if !.has_key?(:coord_interval) raise_argument_required_error('unit') if !.has_key?(:unit) super() end |
Instance Attribute Details
#coord_interval ⇒ Object
Returns the value of attribute coord_interval.
2183 2184 2185 |
# File 'lib/voruby/stc/1.10/stc.rb', line 2183 def coord_interval @coord_interval end |
#unit ⇒ Object
Returns the value of attribute unit.
2183 2184 2185 |
# File 'lib/voruby/stc/1.10/stc.rb', line 2183 def unit @unit end |
Class Method Details
.from_xml(xml) ⇒ Object
2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 |
# File 'lib/voruby/stc/1.10/stc.rb', line 2215 def self.from_xml(xml) root = element_from(xml) = { :unit => PosUnit.new(root.attributes.get_attribute_ns(obj_ns.uri, 'unit').value), :coord_interval => xml_to_obj(root, CoordInterval, true) } self.new() end |
Instance Method Details
#==(i) ⇒ Object
2203 2204 2205 2206 |
# File 'lib/voruby/stc/1.10/stc.rb', line 2203 def ==(i) self.coord_interval == i.coord_interval and self.unit == i.unit end |
#to_xml(name = nil) ⇒ Object
2208 2209 2210 2211 2212 2213 |
# File 'lib/voruby/stc/1.10/stc.rb', line 2208 def to_xml(name=nil) el = element(name) el.attributes["#{obj_ns.prefix}:unit"] = self.unit.to_s el.add_element(self.coord_interval.to_xml) el end |