Module: VORuby::STC::V1_30::STCReference
- Includes:
- SerializableToXml
- Included in:
- Double1Type, ISOTimeType, JDTimeType, PosAngleType, STCBaseType, TimeOffsetType
- Defined in:
- lib/voruby/stc/1.30/stc.rb
Overview
These four attributes represent the standard IVOA referencing system: internal (within the document) referencing through “id” and “idref”, external referencing through Xlink, using only “type=simple” and “href”.
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#idref ⇒ Object
Returns the value of attribute idref.
-
#ucd ⇒ Object
Returns the value of attribute ucd.
-
#xlink_href ⇒ Object
Returns the value of attribute xlink_href.
-
#xlink_type ⇒ Object
Returns the value of attribute xlink_type.
Class Method Summary collapse
Instance Method Summary collapse
Methods included from SerializableToXml
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
99 100 101 |
# File 'lib/voruby/stc/1.30/stc.rb', line 99 def id @id end |
#idref ⇒ Object
Returns the value of attribute idref.
99 100 101 |
# File 'lib/voruby/stc/1.30/stc.rb', line 99 def idref @idref end |
#ucd ⇒ Object
Returns the value of attribute ucd.
99 100 101 |
# File 'lib/voruby/stc/1.30/stc.rb', line 99 def ucd @ucd end |
#xlink_href ⇒ Object
Returns the value of attribute xlink_href.
99 100 101 |
# File 'lib/voruby/stc/1.30/stc.rb', line 99 def xlink_href @xlink_href end |
#xlink_type ⇒ Object
Returns the value of attribute xlink_type.
99 100 101 |
# File 'lib/voruby/stc/1.30/stc.rb', line 99 def xlink_type @xlink_type end |
Class Method Details
.stc_reference_from_xml(el) ⇒ Object
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 |
# File 'lib/voruby/stc/1.30/stc.rb', line 163 def self.stc_reference_from_xml(el) stc_ns = obj_ns('VORuby::STC::V1_30') xlink_ns = obj_ns('VORuby::XLink::V1_2') id_el = el.attributes.get_attribute_ns(stc_ns.uri, 'id') idref_el = el.attributes.get_attribute_ns(stc_ns.uri, 'idref') ucd_el = el.attributes.get_attribute_ns(stc_ns.uri, 'ucd') xlink_type_el = el.attributes.get_attribute_ns(xlink_ns.uri, 'type') xlink_href_el = el.attributes.get_attribute_ns(xlink_ns.uri, 'href') = {} [:id] = Id.new(id_el.value) if id_el [:idref] = IdRef.new(idref_el.value) if idref_el [:ucd] = ucd_el.value if ucd_el [:xlink_type] = XLink::V1_2::Type.new(xlink_type_el.value) if xlink_type_el [:xlink_href] = URI.parse(xlink_href_el.value) if xlink_href_el end |
Instance Method Details
#stc_reference_eq(obj) ⇒ Object
142 143 144 145 146 147 148 |
# File 'lib/voruby/stc/1.30/stc.rb', line 142 def stc_reference_eq(obj) self.id == obj.id and self.idref == obj.idref and self.ucd == obj.ucd and self.xlink_type == obj.xlink_type and self.xlink_href == obj.xlink_href end |
#stc_reference_to_xml(el) ⇒ Object
150 151 152 153 154 155 156 157 158 159 160 161 |
# File 'lib/voruby/stc/1.30/stc.rb', line 150 def stc_reference_to_xml(el) xlink_ns = obj_ns('VORuby::XLink::V1_2') el.add_namespace(xlink_ns.prefix, xlink_ns.uri) el.attributes["#{obj_ns.prefix}:id"] = self.id.to_s if self.id el.attributes["#{obj_ns.prefix}:idref"] = self.idref.to_s if self.idref el.attributes["#{obj_ns.prefix}:ucd"] = self.ucd if self.ucd el.attributes["#{obj_ns('VORuby::XLink::V1_2').prefix}:type"] = self.xlink_type.to_s if self.xlink_type el.attributes["#{obj_ns('VORuby::XLink::V1_2').prefix}:href"] = self.xlink_href.to_s if self.xlink_href el end |