Class: VORuby::STC::V1_30::DiffType

Inherits:
RegionType show all
Defined in:
lib/voruby/stc/1.30/stc.rb

Direct Known Subclasses

Difference, Difference2

Instance Attribute Summary collapse

Attributes inherited from RegionType

#area, #coord_system_id, #note

Attributes inherited from SpatialIntervalType

#epoch, #unit

Attributes inherited from CoordIntervalType

#fill_factor, #frame_id, #hi_include, #lo_include

Attributes included from STCReference

#id, #idref, #ucd, #xlink_href, #xlink_type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from RegionType

region_from_xml

Methods inherited from SpatialIntervalType

spatial_interval_from_xml

Methods inherited from CoordIntervalType

coord_interval_from_xml, #hi_include?, #lo_include?

Methods inherited from STCBaseType

stc_base_from_xml

Methods included from STCReference

#stc_reference_eq, stc_reference_from_xml, #stc_reference_to_xml

Methods included from SerializableToXml

#element

Constructor Details

#initialize(region1, region2, area = nil, lo_include = true, hi_include = true, options = {}) ⇒ DiffType

Returns a new instance of DiffType.



6057
6058
6059
6060
6061
# File 'lib/voruby/stc/1.30/stc.rb', line 6057

def initialize(region1, region2, area=nil, lo_include=true, hi_include=true, options={})
  super(area, lo_include, hi_include, options)
  self.region1 = region1
  self.region2 = region2
end

Instance Attribute Details

#region1Object

Returns the value of attribute region1.



6055
6056
6057
# File 'lib/voruby/stc/1.30/stc.rb', line 6055

def region1
  @region1
end

#region2Object

Returns the value of attribute region2.



6055
6056
6057
# File 'lib/voruby/stc/1.30/stc.rb', line 6055

def region2
  @region2
end

Class Method Details

.from_xml(xml) ⇒ Object



6095
6096
6097
6098
6099
6100
6101
6102
6103
# File 'lib/voruby/stc/1.30/stc.rb', line 6095

def self.from_xml(xml)
  root = element_from(xml)
  
  self.new(
    xml_to_obj(root, Region, true),
    xml_to_obj(root, Region2, true),
    *RegionType.region_from_xml(root)
  )
end

Instance Method Details

#==(d) ⇒ Object



6075
6076
6077
6078
6079
# File 'lib/voruby/stc/1.30/stc.rb', line 6075

def ==(d)
  super(d) and
  self.region1 == d.region1 and
  self.region2 == d.region2
end

#to_sObject



6091
6092
6093
# File 'lib/voruby/stc/1.30/stc.rb', line 6091

def to_s
  "DIFFERENCE(#{self.region1} #{self.region2})"
end

#to_xml(name = nil) ⇒ Object



6081
6082
6083
6084
6085
6086
6087
6088
6089
# File 'lib/voruby/stc/1.30/stc.rb', line 6081

def to_xml(name=nil)
  el = super(name)
  
  el.add_element(self.region1.to_xml)
  el.add_element(self.region2.to_xml)
  
  collapse_namespaces(el)
  el
end