ga-wdi-boston / ruby-enumerable-comparable

Other
1 stars 139 forks source link

explain private #5

Closed RealWeeks closed 7 years ago

RealWeeks commented 8 years ago

"private means you can't call (foo) below line (number)

jrhorn424 commented 8 years ago

Good catch. 😉

gaand commented 8 years ago

@J-Weeks @jrhorn424 Would one or both of you please explain this issue? Thanks.

RealWeeks commented 8 years ago

@gaand In the original teaching of this lesson private was used and it lead to some student confusion.

jrhorn424 commented 8 years ago

It was something like this:

class Foo
  def bar
    "baz"
  end
  private :bar

  def qux
    bar # this works
  end
end

Foo.new.bar # this does not work

I believe this can be closed. @J-Weeks @gaand

gaand commented 8 years ago

I didn't use it last time (although I should have done).

Your example captures the meaning.

I am not sure if it's actually in the repo, so something to prompt its use other than memory?

jrhorn424 commented 8 years ago

Yep. Maybe even adding something like my example above would be enough.

RealWeeks commented 8 years ago

@jrhorn424 @gaand Please feel free to close if discussion is over. Don't want to close mid-conversation.

jrhorn424 commented 8 years ago

It's not closable if it isn't addressed.

jrhorn424 commented 8 years ago

This should be mentioned when building the deck.