Class: SPSS::Dictionary::LabelSet
- Inherits:
-
Object
- Object
- SPSS::Dictionary::LabelSet
- Defined in:
- lib/spss.rb
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
65 66 67 |
# File 'lib/spss.rb', line 65 def initialize(labels) @labels=labels end |
Instance Method Details
#parse_spss ⇒ Object
71 72 73 |
# File 'lib/spss.rb', line 71 def parse_spss() @labels.collect{|key,value| "#{key} '#{value}'"}.join("\n ") end |
#parse_xml(name) ⇒ Object
68 69 70 |
# File 'lib/spss.rb', line 68 def parse_xml(name) "<valueLabelSet>\n "+@labels.collect{|key,value| "<valueLabel label='#{key}' value='#{value}' />"}.join("\n ")+"\n <valueLabelVariable name='#{name}' />\n</valueLabelSet>" end |