Class: SPSS::Dictionary::Dictionary

Inherits:
Element show all
Defined in:
lib/spss.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Element

#add, #init_with, #parse_elements

Constructor Details

#initialize(config = {}) ⇒ Dictionary

Returns a new instance of Dictionary.



33
34
35
36
37
38
39
40
41
# File 'lib/spss.rb', line 33

def initialize(config = {})
  super
  init_with ({
          :locale=>"en_US",
          :date_time=>Time.new().strftime("%Y-%m-%dT%H:%M:%S"),
          :row_count=>1
  })
  init_with config
end

Instance Attribute Details

#date_timeObject

Returns the value of attribute date_time.



32
33
34
# File 'lib/spss.rb', line 32

def date_time
  @date_time
end

#localeObject

Returns the value of attribute locale.



32
33
34
# File 'lib/spss.rb', line 32

def locale
  @locale
end

#row_countObject

Returns the value of attribute row_count.



32
33
34
# File 'lib/spss.rb', line 32

def row_count
  @row_count
end

Instance Method Details

#to_spssObject



47
48
49
# File 'lib/spss.rb', line 47

def to_spss
  parse_elements(:to_spss)
end

#to_xmlObject



43
44
45
46
# File 'lib/spss.rb', line 43

def to_xml
  "<dictionary locale='#{@locale}' creationDateTime='#{@date_time}' rowCount='#{@row_count}' xmlns='http://xml.spss.com/spss/data'>\n"+parse_elements(:to_xml)+"\n</dictionary>"

end