title: Different obj_id but equal values in ruby?
body: <p>I'm fairly new to ruby and am practicing it.
  However in this exercise I'm doing it creates two bank accounts using the same method and same values, and the program expects both to be equal.
  RSpec returns this to me:</p>
  
  <pre><code>Failure/Error: expect(conta1).to eql conta2
  
     expected: #&lt;Conta:0x3161bc8 @numero="2303-2", @nome="Jose da Silva", @saldo=1000.1, @limite=500&gt;
          got: #&lt;Conta:0x31615f8 @numero="2303-2", @nome="Jose da Silva", @saldo=1000.1, @limite=500&gt;
  
     (compared using eql?)
  
     Diff:
     @@ -1,4 +1,4 @@
     -#&lt;Conta:0x3161bc8
     +#&lt;Conta:0x31615f8
       @limite=500,
       @nome="Jose da Silva",
       @numero="2303-2",
  </code></pre>
  
  <p>The content of both the accounts are the same, but there's a conflict on the object_id, how do I resolve this?</p>
  
  <p>Here is the code:</p>
  
  <pre><code>it "Two accounts with the same data should be equal" do
  conta1 = cria_conta
  conta2 = cria_conta
  expect(conta1).to eql conta2
  end
  
  def cria_conta(numero="2303-2", nome="Jose da Silva", saldo=1000.10, limite=500)
  Conta.new(numero: numero, nome: nome, saldo: saldo, limite: limite)
  end
  </code></pre>
  
  <p>Also:</p>
  
  <pre><code>class Conta
  attr_accessor :numero, :nome, :saldo, :limite
  
  def initialize(arr)
      @numero = arr[:numero]
      @nome = arr[:nome]
      @saldo = arr[:saldo]
      @limite = arr[:limite]
  end
  
  def sacar(valor)
      possibilidade = false
      @@valor = valor
      if valor &lt; @saldo
          @saldo -= valor
          possibilidade = true
      elsif valor &gt; @limite
          @saldo -= valor
          @@saldo = @saldo
          possibilidade
      end
  end
  
  def no_limite?()
      if @@valor &gt; @limite
          return true
      elsif @@valor &lt; @limite
          return false
      end 
  end
  
  def depositar(valor)
      @saldo += valor
  end
  
  def ==(outra_conta)
  self.conta == outra_conta
  </code></pre>
  
  <p>end
  end</p>
  
  <p>I tried to define a a diffrent method for == but I was unsuccessful.</p>