addressalign-toparrow-leftarrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobegmailgooglegroupsimageimagesinstagramlinklocation-pinm-swarmSearchmailmessagesminusmoremuplabelShape 3 + Rectangle 1outlookpersonJoin Group on CardStartprice-ribbonImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruseryahoo

Arlington Ruby Message Board › Help.... What am I doing wrong...

Help.... What am I doing wrong...

Sis Summer J.
user 97887392
Washington, DC
Post #: 8

class BankAccount
def full_name(first_name, last_name)
return first_name + " " + last_name
Sean M.
Arlington, VA
Post #: 13
Is this an excerpt or the whole class? Where is the first_name and last_name coming from?

To get this to work as written, you could do something like:
class BankAccount
attr_accessor :first_name, :last_name

def full_name
"#{first_name} #{last_name}"

Feel free to bring your code by the meetup on Wednesday if you are coming and I'd be happy to help or walk you through things.
Powered by mvnForum

Our Sponsors

  • New Relic

    Application performance monitoring

  • Clean Ruby

    Get the ebook by Jim Gay about Ruby, OOP, and DCI

  • O'Reilly

    Discounts on print and ebooks.

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy