Class: Cv::Param

Inherits:
Object
  • Object
show all
Defined in:
lib/cv/param.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cv_ref, accession, name, value = nil) ⇒ Param

Returns a new instance of Param.



6
7
8
# File 'lib/cv/param.rb', line 6

def initialize(cv_ref, accession, name, value=nil)
  (@cv_ref, @accession, @name, @value) = [cv_ref, accession, name, value]
end

Instance Attribute Details

#accessionObject

Returns the value of attribute accession.



4
5
6
# File 'lib/cv/param.rb', line 4

def accession
  @accession
end

#cv_refObject

Returns the value of attribute cv_ref.



4
5
6
# File 'lib/cv/param.rb', line 4

def cv_ref
  @cv_ref
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/cv/param.rb', line 4

def name
  @name
end

#valueObject

Returns the value of attribute value.



4
5
6
# File 'lib/cv/param.rb', line 4

def value
  @value
end

Instance Method Details

#to_xml(xml, name = :cvParam) ⇒ Object



10
11
12
13
14
# File 'lib/cv/param.rb', line 10

def to_xml(xml, name=:cvParam)
  hash_to_send = {:cvRef => @cvref, :accession => @accession, :name => @name}
  hash_to_send[:value] = @value if @value
  xml.send(name, hash_to_send)
end