Class: VORuby::STC::V1_10::STC::StcDescription

Inherits:
StcMetadataType show all
Defined in:
lib/voruby/stc/1.10/stc.rb

Overview

Generalized single stcMetadata type

Defined Under Namespace

Classes: CoordSysList

Instance Attribute Summary collapse

Attributes inherited from StcMetadataType

#id

Instance Method Summary collapse

Methods included from SerializableToXml

#element

Constructor Details

#initialize(options = {}) ⇒ StcDescription

Returns a new instance of StcDescription.



2821
2822
2823
2824
# File 'lib/voruby/stc/1.10/stc.rb', line 2821

def initialize(options={})
  raise_argument_required_error('list of coordinate systems') if !options.has_key?(:coord_sys)
  super(options)
end

Instance Attribute Details

#coord_areasObject

Returns the value of attribute coord_areas.



2814
2815
2816
# File 'lib/voruby/stc/1.10/stc.rb', line 2814

def coord_areas
  @coord_areas
end

#coord_sysObject

Returns the value of attribute coord_sys.



2814
2815
2816
# File 'lib/voruby/stc/1.10/stc.rb', line 2814

def coord_sys
  @coord_sys
end

#coordsObject

Returns the value of attribute coords.



2814
2815
2816
# File 'lib/voruby/stc/1.10/stc.rb', line 2814

def coords
  @coords
end

Instance Method Details

#==(d) ⇒ Object



2847
2848
2849
2850
2851
2852
# File 'lib/voruby/stc/1.10/stc.rb', line 2847

def ==(d)
  super(d) and
  self.coord_sys == d.coord_sys and
  self.coords == d.coords and
  self.coord_areas == d.coord_areas
end

#to_xml(name = nil) ⇒ Object



2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
# File 'lib/voruby/stc/1.10/stc.rb', line 2854

def to_xml(name=nil)
  el = super(name)
  
  if self.coord_sys
    self.coord_sys.is_a?(Array) ? self.coord_sys.each { |s| el.add_element(s.to_xml) } : el.add_element(self.coord_sys.to_xml)
  end
  
  if self.coords
    self.coords.is_a?(Array) ? self.coords.each { |c| el.add_element(c.to_xml) } : el.add_element(self.coords.to_xml)
  end
  
  if self.coord_areas
    self.coord_areas.is_a?(Array) ? self.coord_areas.each { |a| el.add_element(a.to_xml) } : el.add_element(self.coord_areas.to_xml)
  end
  
  collapse_namespaces(el)
  el
end