Class: SPSS::Dictionary::LabelSet

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

Instance Method Summary collapse

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_spssObject


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