Skip to content

Episode6 - Assignments #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Episode6 - Assignments #18

wants to merge 7 commits into from

Conversation

mee213
Copy link

@mee213 mee213 commented Jan 22, 2014

Hi Jesse, here's Panda assignment for Episode 6 of Ruby Newbie. Thanks! ~Marlo

@mee213
Copy link
Author

mee213 commented Jan 22, 2014

Also Tiger assignment.

@jwo
Copy link
Member

jwo commented Jan 22, 2014

@mee213 looks great! perfect execution.

@mee213
Copy link
Author

mee213 commented Jan 22, 2014

Not attempting TDD yet, just #1 and #2 of Eagle assignment, see vehicle.rb. I know I need help with this one!


@@allvehicles = []

def initialize
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With class variables, just doing is enough to initialize them. so your def initialize isn't needed

@@allvehicles = []

@mee213
Copy link
Author

mee213 commented Jan 22, 2014

Not sure I understand your comment on Eagle exercise #1... when then does array get appended with new instance?

@mee213
Copy link
Author

mee213 commented Jan 22, 2014

Oh, is this what you meant, taking out the

@@allvehicles = []

line?

@jwo
Copy link
Member

jwo commented Jan 22, 2014

Nope:

Remove:

def initialize
  @@allvehicles << self
end

And keep

@@allvehicles = []

@mee213
Copy link
Author

mee213 commented Jan 22, 2014

OK, I've made the change, but still not clear... I understand I've created an empty array, but I don't understand how it gets populated?

@jwo
Copy link
Member

jwo commented Jan 22, 2014

OK, my apologies :(

This is perfectly fine

def initialize
  @@allvehicles << self
end

I thought you were doing this (which is quite common)

def initialize
  @@allvehicles << []
end

Sooooo. yeah. Everything was good on yours except the matching

@mee213
Copy link
Author

mee213 commented Jan 22, 2014

ok... what do you mean by "except the matching"?

@jwo
Copy link
Member

jwo commented Jan 22, 2014

ok... what do you mean by "except the matching"?

I meant this comment #18 (comment)

@mee213
Copy link
Author

mee213 commented Jan 23, 2014

Ok! Got it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants