Class: SPSS::Dictionary::LabelSet
Instance Method Summary collapse
-
#initialize(labels) ⇒ LabelSet
constructor
A new instance of LabelSet.
- #parse_spss ⇒ Object
- #parse_xml(name) ⇒ Object
Constructor Details
#initialize(labels) ⇒ LabelSet
Returns a new instance of LabelSet.
68 69 70 |
# File 'lib/spss.rb', line 68 def initialize(labels) @labels=labels end |
Instance Method Details
#parse_spss ⇒ Object
74 75 76 |
# File 'lib/spss.rb', line 74 def parse_spss() @labels.collect{|key,value| "#{key} '#{value}'"}.join("\n ") end |
#parse_xml(name) ⇒ Object
71 72 73 |
# File 'lib/spss.rb', line 71 def parse_xml(name) "<valueLabelSet>\n "+@labels.collect{|key,value| "<valueLabel label='#{key}' value='#{value}' />"}.join("\n ")+"\n <valueLabelVariable name='#{name}' />\n</valueLabelSet>" end |