title: What is the mysterious Data Class in Ruby?
body: <p>Today, I accidentally discovered the mysterious Data class in Ruby, and I can't find any useful information upon what it does, or why it's there. I assume it's part of the language implementation itself.</p>
  
  <p>Does anybody know what it does?</p>
  
  <pre><code>mbp-scott:~ scott$ irb
  ruby-1.9.3-p0 :001 &gt; Data
  =&gt; Data
  ruby-1.9.3-p0 :002 &gt; Data.is_a? Module
  =&gt; true
  ruby-1.9.3-p0 :003 &gt; Data.is_a? Class
  =&gt; true
  ruby-1.9.3-p0 :004 &gt; Data.ancestors
  =&gt; [Data, Object, Kernel, BasicObject]
  ruby-1.9.3-p0 :005 &gt; Data.methods
  =&gt; [:allocate, :new, :superclass, :freeze, :===, :==, :&lt;=&gt;, :&lt;, :&lt;=, :&gt;,
  :&gt;=, :to_s,:included_modules, :include?, :name, :ancestors, :instance_methods,
  :public_instance_methods, :protected_instance_methods, :private_instance_methods,
  :constants, :const_get, :const_set, :const_defined?, :const_missing, :class_variables,
  :remove_class_variable, :class_variable_get, :class_variable_set,
  :class_variable_defined?, :public_constant, :private_constant, :module_exec,
  :class_exec, :module_eval, :class_eval, :method_defined?, :public_method_defined?,
  :private_method_defined?, :protected_method_defined?, :public_class_method
  :private_class_method, :autoload, :autoload?, :instance_method, :public_instance_method,
  :nil?, :=~, :!~, :eql?, :hash, :class, :singleton_class, :clone, :dup, :initialize_dup,
  :initialize_clone, :taint, :tainted?, :untaint, :untrust, :untrusted?, :trust, :frozen?,
  :inspect, :methods, :singleton_methods, :protected_methods, :private_methods,
  :public_methods, :instance_variables, :instance_variable_get, :instance_variable_set,
  :instance_variable_defined?, :instance_of?, :kind_of?, :is_a?, :tap, :send,
  :public_send, :respond_to?, :respond_to_missing?, :extend, :display, :method,
  :public_method, :define_singleton_method, :object_id, :to_enum, :enum_for, :equal?,
  :!, :!=, :instance_eval, :instance_exec, :__send__, :__id__]
  ruby-1.9.3-p0 :006 &gt; Data.instance_variables
  =&gt; []
  ruby-1.9.3-p0 :007 &gt; self
  =&gt; main
  </code></pre>