From: "Jesús Gabriel y Galán" Date: 2011-12-11T19:55:26+09:00 Subject: Re: Scope and Instance Variable Question On Sun, Dec 11, 2011 at 1:16 AM, Cleverlemming wrote: > Hail Caesars! > > I'm wondering why the instance variable "@spree_invoice_number" is out > of scope in both the authorize and the create_transaction methods in > the appended code. Both of the aforementioned methods are called after > the create_profile method, where the instance variable is > initialized.  I checked to make sure the instance variable name is > unique in both the application and the gem repository. > > Thanks in advance for any suggestions! Can you show the caller code? From your description and the code, everything looks good. Can you try with a simpler version of your class: class Gateway::AuthorizeNetCim < Gateway attr_accessor :spree_invoice_number def authorize(amount, creditcard, gateway_options) logger.debug("variable is: #{@spree_invoice_number}") end def create_profile payment @spree_invoice_number = 42 end end Jesus.