Class: VORuby::STC::V1_30::RegionFileType

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

Overview

Points to a Region file.

Direct Known Subclasses

RegionFile

Instance Attribute Summary collapse

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 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(file, lo_include = true, hi_include = true, options = {}) ⇒ RegionFileType

Returns a new instance of RegionFileType.



4783
4784
4785
4786
# File 'lib/voruby/stc/1.30/stc.rb', line 4783

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

Instance Attribute Details

#fileObject

Returns the value of attribute file.



4781
4782
4783
# File 'lib/voruby/stc/1.30/stc.rb', line 4781

def file
  @file
end

Class Method Details

.from_xml(xml) ⇒ Object



4808
4809
4810
4811
4812
4813
4814
4815
# File 'lib/voruby/stc/1.30/stc.rb', line 4808

def self.from_xml(xml)
  root = element_from(xml)
  
  self.new(
    URI.parse(REXML::XPath.first(root, 'x:File', {'x' => obj_ns.uri}).text),
    *SpatialIntervalType.spatial_interval_from_xml(root)
  )
end

Instance Method Details

#==(r) ⇒ Object



4793
4794
4795
4796
# File 'lib/voruby/stc/1.30/stc.rb', line 4793

def ==(r)
  super(r) and
  self.file == r.file
end

#to_xml(name = nil) ⇒ Object



4798
4799
4800
4801
4802
4803
4804
4805
4806
# File 'lib/voruby/stc/1.30/stc.rb', line 4798

def to_xml(name=nil)
  el = super(name)
  
  file_el = REXML::Element.new("#{obj_ns.prefix}:File")
  file_el.text = self.file.to_s
  el.add_element(file_el)
  
  el
end