title: Attributes of an Object
body: <p>There is function of attributes_name in Active record by which I can check the keys of an object but I can check the blank keys for of an object which is of MongoID not of ActiveRecord, 
  When I try this I got the following response </p>
  
  <pre><code>ruby-1.9.2-p290 :001 &gt; u = User.new
  =&gt; #&lt;User _id: 4e684f7771393161cc000001, _type: nil, username: nil, first_name: nil, last_name: nil, email: nil, password: nil, password_salt: nil, password_hash: nil, profile_picture: nil, facebook_id: nil, facebook_enabled: nil, facebook_access_token: nil, twitter_id: nil, twitter_enabled: nil, twitter_access_token: nil, twitter_access_secret: nil, points: nil, remember_token: nil, remember_token_expires_at: nil, active: false, activation_code: nil, activated_at: nil&gt; 
  ruby-1.9.2-p290 :002 &gt; u.attributes.keys
  =&gt; ["active", "_id"] 
  </code></pre>
  
  <p>It only show the attributes which are not nill , How can I check all the attributes even which are nil ?
  I actually wanted to make function which needs to use user.attributes.keys.include?('name')</p>