title: Adding an instance variable using enumerable#map returns wrong information
body: <p>I'm currently working on a Rails/Mapbox app. I currently am not storing geolocation for my <code>House</code> object, and rather am using a helper method to create a temporary instance variable to store geolocation to pass to Mapbox.</p>
  
  <p>Below, <code>all_houses</code> argument is an array of many <code>House</code> objects.</p>
  
  <p>I created the following helper method:</p>
  
  <pre><code>def add_geolocation(all_houses)
    all_houses.map do |house|
      house_geo = find_geolocation(house.address)
  
      class &lt;&lt; house
        attr_accessor :geo
      end
  
      house.geo = house_geo
    end
  end
  </code></pre>
  
  <p>I'm using the Gon Gem to pass this information from my controller to Mapbox. What is being returned is an array of arrays with only geolocations stored for each house. What I am trying to do is pass every instance variable stored for the each <code>House</code> object and also pass its geolocation.</p>
  
  <p>Also, to add, I have also tried the Ruby method Object#set_instance_variable and I am getting the same result.</p>
  
  <p>What I want:</p>
  
  <pre><code>[&lt;House:0x007fe5670d9cc0 @a="a", @b="b", @geo=[10, 10]&gt;, &lt;House:0x007fe5670d9cc0 @a="a", @b="b", @geo=[10, 11]&gt;, &lt;House:0x007fe5670d9cc0 @a="a", @b="b", @geo=[12, -12]&gt;, ...]
  </code></pre>
  
  <p>What I am getting is an Array of Arrays with only geolocations, for example:</p>
  
  <pre><code>[[10, 10], [10, 11], [12, -12] ...]
  </code></pre>
  
  <p>Edit:</p>
  
  <p>Below is what I have in my controller. <code>gon</code> is from the Gon Gem</p>
  
  <pre><code>def index
    @houses = House.all
    json_houses = add_geolocation(House.all)
  
    gon.houses = json_houses
  end
  </code></pre>