Class: VORuby::STC::V1_30::NegationType

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

Overview

The negation of a region is a region.

Direct Known Subclasses

Negation, Negation2

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(region, area = nil, lo_include = true, hi_include = true, options = {}) ⇒ NegationType

Returns a new instance of NegationType.



6017
6018
6019
6020
# File 'lib/voruby/stc/1.30/stc.rb', line 6017

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

Instance Attribute Details

#regionObject

Returns the value of attribute region.



6015
6016
6017
# File 'lib/voruby/stc/1.30/stc.rb', line 6015

def region
  @region
end

Class Method Details

.from_xml(xml) ⇒ Object



6044
6045
6046
6047
6048
6049
6050
6051
# File 'lib/voruby/stc/1.30/stc.rb', line 6044

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

Instance Method Details

#==(n) ⇒ Object



6028
6029
6030
6031
# File 'lib/voruby/stc/1.30/stc.rb', line 6028

def ==(n)
  super(n) and
  self.region == n.region
end

#to_sObject



6040
6041
6042
# File 'lib/voruby/stc/1.30/stc.rb', line 6040

def to_s
  "NOT(#{self.region})"
end

#to_xml(name = nil) ⇒ Object



6033
6034
6035
6036
6037
6038
# File 'lib/voruby/stc/1.30/stc.rb', line 6033

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