title: Accessing a RoR ActiveRecord's attributes from within the ActiveRecord instance
body: <p>I am confused about how to access the attributes of an ActiveRecord instance from a method within the ActiveRecord instance.</p>
  
  <p>For example I have a Lead class that inherits from ActiveRecord:</p>
  
  <pre><code>class Lead &lt; ActiveRecord::Base
  end
  </code></pre>
  
  <p>I have the following scaled down migration file that shows the columns of an ActiveRecord table:</p>
  
  <pre><code>class CreateLeads &lt; ActiveRecord::Migration
    def self.up
      create_table :leads do |t|
        t.string :phone_1
        t.string :phone_2
        t.string :web
        t.string :fax
        t.timestamps
      end
    end
    def self.down
      drop_table :leads
    end
  end
  </code></pre>
  
  <p>I am using send in a method of the Lead class to set these attributes internally like this:</p>
  
  <pre><code>def instance_method(prop)
    self.send("#{prop}=".to_sym, value_node.text) 
  end
  </code></pre>
  
  <p>The question I have is how do I access these :phone_1, :phone_2 attributes when within the ActiveRecord instance itself without having to use send which is the only way I can think of.  I think these attributes are accessed via method_missing when accessing them from the public interface like this:</p>
  
  <pre><code>puts lead.phone_1
  </code></pre>
  
  <p>But I have no idea how to access them from within the ActiveRecord instance apart from via send.</p>
  
  <p>Is it possible?</p>