title: Why doesn't initialize appear as a method when I call on the instance methods of a class?
body: <p>I'm writing a blog post on how almost everything is an object in Ruby, and I'm trying to show this through the following example:</p>
  
  <pre><code>class CoolBeans
    attr_accessor :beans
  
    def initialize
      @bean = []
    end
  
    def count_beans
      @beans.count
    end 
  
  end
  </code></pre>
  
  <p>So from looking at the class we can tell it has 4 methods(unless of course, I'm wrong):</p>
  
  <ol>
  <li>It can initialize a default empty array of beans when a new instance is created</li>
  <li>It can count how many beans it has</li>
  <li>It can read how many beans it had (through the <code>attr_accessor</code>)</li>
  <li>It can write(or add) more beans to the empty array (also through the <code>attr_accessor</code>)</li>
  </ol>
  
  <p>However, when I ask the class itself what instance methods it has, I don't see the default <code>initialize</code> method:</p>
  
  <pre><code>CoolBeans.new.class.instance_methods
  # =&gt; [:beans, :beans=, :count_beans, :lm, :lim, :nil?, :===, :=~, :!~, :eql?, :hash, :&lt;=&gt;, :class, :singleton_class, :clone, :dup, :itself, :taint, :tainted?, :untaint, :untrust, :untrusted?, :trust, :freeze, :frozen?, :to_s, :inspect, :methods, :singleton_methods, :protected_methods, :private_methods, :public_methods, :instance_variables, :instance_variable_get, :instance_variable_set, :instance_variable_defined?, :remove_instance_variable, :instance_of?, :kind_of?, :is_a?, :tap, :send, :public_send, :respond_to?, :extend, :display, :method, :public_method, :singleton_method, :define_singleton_method, :object_id, :to_enum, :enum_for, :==, :equal?, :!, :!=, :instance_eval, :instance_exec, :__send__, :__id__] 
  </code></pre>
  
  <p>Does this mean that the initialize method is not an instance method?  If not, why isn't it showing up as a method available to the class <code>CoolBeans</code>?</p>