From: Josh Cheek Date: 2011-08-26T17:14:55+09:00 Subject: Re: How the access the values of this result --f46d042fd8f0dcb0f404ab642367 Content-Type: text/plain; charset=ISO-8859-1 On Fri, Aug 26, 2011 at 2:33 AM, QAS WM wrote: > I am getting the following as a result of a script I run. > > # @address2="1000 N WICKHAM RD", @zip4="8937", @state="FL"> > > in a variable named result. > > How can I access just the Address value and print it on the screen? > > -- > Posted via http://www.ruby-forum.com/. > > What version/implementation of Ruby are you using? That's a curious inspection, none of mine label it as the address. Anyway, that's the address of the object in memory, not the location you're sending the package, you probably want @address2. Given that I don't know how your object works, I can't say for sure. Usually people will have a getter named the same as the variable, so you could just say result.address2. If not, the only think you can definitely do would be a violation of encapsulation, but you could say result.instance_variable_get('@address2'), but I recommend finding the actual getter (note, if you don't know your object's APIs, and they aren't well documented, Pry is a good tool for exploring them http://pry.github.com/). --f46d042fd8f0dcb0f404ab642367--