Class: VORuby::VOTables::VOTable::Meta::ParamRef

Inherits:
Object
  • Object
show all
Defined in:
lib/voruby/votables/meta.rb,
lib/voruby/votables/transforms.rb,
lib/voruby/votables/rexml_parser.rb,
lib/voruby/votables/libxml_parser.rb

Overview

A class representing the standard VOTable PARAMref element.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ref = nil) ⇒ ParamRef

ref:

A reference to a PARAM element.



210
211
212
213
214
# File 'lib/voruby/votables/meta.rb', line 210

def initialize(ref=nil)
raise "Parameter reference must define a reference" if ref == nil
	
@ref = ref
end

Instance Attribute Details

#refObject (readonly)

Returns the value of attribute ref.



206
207
208
# File 'lib/voruby/votables/meta.rb', line 206

def ref
  @ref
end

Class Method Details

.from_soap_obj(mparamrefs) ⇒ Object



204
205
206
207
208
209
210
211
212
213
214
215
# File 'lib/voruby/votables/transforms.rb', line 204

def self.from_soap_obj(mparamrefs)
  mparamrefs = [mparamrefs] if !mparamrefs.respond_to?(:each)

  paramrefs = []
  mparamrefs.each do |mparamref|
    paramrefs.push(ParamRef.new(
      VOTABLE::VOTable::_find_attr_value(mparamref.__xmlattr, 'ref')
    ))
  end

  paramrefs        
end

.from_xml(node) ⇒ Object



86
87
88
89
90
# File 'lib/voruby/votables/rexml_parser.rb', line 86

def self.from_xml(node)
ref = node.attributes['ref'] if node.attributes['ref']
	
return self.new(ref)
end

Instance Method Details

#to_sObject



216
217
218
# File 'lib/voruby/votables/meta.rb', line 216

def to_s
"{#{@ref}}"
end