►
Description
Discussion for Chapter 6: Method Lookup and Constant Lookup
A
B
Yeah
so
I'm
kind
of
you're
in
portland,
yeah,
yeah
yeah,
so
I'm
kind
of
more.
I
guess
east
a
little
bit
north,
I'm
in
the
college,
place
walla
walla
area,
okay,
so
kind
of
yeah
we're
we're
still
like.
I
don't
know
five
or
ten
minutes
from
the
oregon
border.
So
it's
not
too
far
north,
but
pretty
far
east
yeah.
A
B
So,
let's
see
this
week,
we're
going
over,
I
think
chapter
six
is
what
we're
on
method
lookup
and
constant
lookup.
So
there
were
a
couple
of
points.
While
I
was
reading
this
chapter,
I
was
like
wait.
What
how
does
it
do
that?
But
then
I
explained
it
later
most
of
time,
but
there
was
one
that
stuck
with
me,
which
was
kind
of
an
example
near
the
end
where,
like
we'd,
included
a
module
in
a
class
and
then
later
we
added
a
method
to
that
module
and
it
showed
up
for
an
instance
of
that
class.
B
But
if
we
added
another
module
or
some
other
constant,
then
it
did
not
show
up,
and
I
was
kind
of
like
why
why?
Why
make
that
choice?
So
I'm
wondering
if
there's
a
an
object-oriented
like
design
principle
or
something
behind
that
or
if
that's
just
a
choice
that
was
made
and
now
we
just
live
with
it.
A
B
Yeah
yeah
the
whole
the
whole,
like,
I
guess,
acrobatics,
that
ruby
does
behind
the
scenes
for
super
classes
and
for
all
these
modules
and
pre-pending
modules
and
how
how
that
all
just
stacks
up
to
be
essentially
a
super
class
chain,
but
yeah,
not
the
one
that
you
would
expect
to
find.
Necessarily
so
you
kind
of
have
to
know
what
order
things
are
being
inserted
in
yeah.
I
just
found
that
really
really
fascinating.
A
I'm
not
sorry,
someone
probably
should
be
taking
notes.
I
don't
think.
A
The
the
pre-pen
thing
it
made
me
wonder
if
that
was
done
in
a
reactive
mode,
rather
than
being
thought
out.
So
the
way
the
super
class
chain
does
its
look
up.
So
I
wonder
if
later
on,
they
said.
Oh,
maybe
it
shouldn't
be
that
way,
and
we
should
find
a
way
to
circumvent
that.
So,
let's
add
in
pre-pen
later
on,
so
that
you
could
then
restructure
the
order
without
breaking
anything
right.
Knowing
that
people
have
built
it
one
way
and
then
you're
introducing
a
new
way.
So.
A
C
Was
definitely
like
like
when
it
first
was
explaining
how
like
modules
are
just
inserted
like
as
the
super
class
like
at
first,
I
was
like
oh
well
now.
This
all
makes
sense.
I
will
understand
you
know
the
precedence
of
of
my
different.
A
C
A
C
A
C
Yeah
the
entire
idea
of
when,
when
you
get
to
constance
and
lexical
scoping
of
I'm
just
saying
like,
like
they
very
nonchalantly,
said
by
the
way
there's
a
second
tree.
We've
been
looking
at
this
tree,
the
whole
time,
but
there's
another
one
too,
which
I
thought
like
it's,
it's
very
cool.
How
there's
these
two
intertwined
trees
that
you
can
follow
to
to
understand
your
definitions,
but
it
was
interesting
how
we
had
we
hadn't
like
seen
that
yet.
A
Yeah,
did
you
all
get
the
example
wrong?
So
when
I
read
that
first
example
when
they,
I
can't
remember
how
it
was
structured.
C
A
And
they
were
doing
constant
lookups,
I
figured
it
was
gonna
go
with
the
super
class
first,
but
of
course
it
didn't
and
then
they
had
to
go,
explain
and
I'm
sure
they
knew
what
they
were
doing
when
they
wrote
the
book,
but
that
was
yeah.
It
made
me
scratch
my
head
for
a
while,
which
one
was
that
on
the
constant
lookup.
So
let
me
go
and
find
the
example
because
I'm
not
describing
it
well
at
all.
Yeah.
C
C
Yeah,
that
was
one
where
I
expected
superclass
to
to
win.
Yes,
and
it's
something
that
I
like.
It's
interesting,
that
I
don't
pay
attention
to
the
to
this
when
I'm
writing
ruby,
like
I'm
aware
of
like
when
I'm
in
modules.
But
I
don't.
I
don't
realize
that
there's
like
modules
as
a
namespace
and
then
modules
as
a
module
and
they
can
exhibit
different
behaviors
to
an.
B
B
I
think
so
so
it's
the
one
where
they've
got
the
namespace
module
and
then
some
constant
and
then
the
subclass
and
they're
putting
some
constant
so
yeah.
So
what
were
you
guys
saying
about
that?
I'm
trying
to
wrap
my
head
around
this
again,
see
where
I
was
in
my
frame
of
mind
when
I
read
through
it.
B
Oh,
so
that
right,
that
lookup
of
of
scope
first
and
then
super
class,
a
second
yeah.
B
C
C
B
B
Anyway,
I'll
take
your
word
for
it,
steve
I'm
having
trouble
finding
but
yeah.
I
remember
that
moment
as
well
like
like,
when
they
kind
of
showed
how
it
looks
up
in
the
scope,
because
they're
not
necessarily
super
classes
or
or
included.
You
know.
Modular
thing
is
just
a
module
scope,
but
still
finds
things
there
and
then
it
was
like.
You
know
the
scope
versus
the
super
class
which
one's
going
to
win,
and
I
was
like
I
don't
know,
that's
the
question
I
had
like,
which
one
would
win.
C
Well,
I
do
think
one
of
the
things
that
is
interesting
is
like
when
I
work
in
in
ruby
like
this.
So
if
you
had,
you
know
a
module
wrapped
around
a
class
and
the
class
was
going
to
call
a
constant
from
that
parent
module.
I
would
still
probably
explicitly
spell
it
all
out.
I
would
say:
module
colon
colon
something
colon
calling.
C
B
Explicit
yeah,
I
think
I've
run
into
that
a
couple
times
myself,
and
especially
like
so
I
work
a
lot
on
sort
of
our
experimentation
framework,
and
so
we
have
this
this
notion
of,
like
in
the
lib
directory.
We
have
like
git
lab
directory
and
module,
and
then
we
have
like
we
have
experimentation
in
there
and
then
experimentation
has
its
own
sort
of
experiment
class,
but
then
we
also
have
an
experiment
mod
model.
B
So
then
it's
like
which
experiment
do
you
mean,
and
so
you
have
to
be
very
explicit,
like
with
the
colon
colon
prefix
and
whatever
to
like,
get
it
at
just
the
right
one
you
want.
So
I'm
wondering
if
that's
one
of
the
reasons
that
they
are
starting
this.
This
push
to
name
space.
Everything
in
in
our
project.
A
What's
happening
internally
within
gitlab
having
a
coding
standard
of
namespacing,
everything.
B
Yeah
they
just
recently
added
a
rubocop
and
then
kind
of
like
everything
got
added
to
the
current
like
excludes
list
or
whatever
for
that
rubocop
and
so
we're
supposed
to
work
through
that
list
and,
like
start
name,
spacing
every
single
class,
pretty
much
basically
with
like
whatever
domain
it's
under.
As
far
as
like
git
lab,
you
know,
work
domains.
I
guess
you
could
say
yeah.
A
B
Knowledge
domains
so
yeah,
so
it's
kind
of
an
interesting
idea
like
one
it
makes
it
makes
it
a
lot
more
clear
when
you're
working
in
something
like
what
domain
really
sort
of
owns
that
and
so
where
you
need
to
go.
If
you
want
some
expertise,
help
on
it,
but
two,
it
probably
reduces
a
lot
of
this
kind
of
class
name,
conflict.
B
B
Yeah
there's
one
part
in:
let's
see
the
sections
where
classes
don't
see,
sub
modules
included
later,
which
I
guess
is
kind
of
what
we
were
just
talking
about.
B
So
oh
wait,
so
the
one
before
that
sorry
classes
c
methods
added
to
a
module
later,
so
the
one
where
methods
do
show
up
and
at
the
very
end
of
that
the
sentence
is
like
no
surprise
here
either.
Ruby
is
one
step
ahead
of
us.
I
was
like
big
surprise
here,
like
I
didn't
expect,
but
that
would
be
no
surprises,
so
I'm
glad
they
explained
it
later,
but
I
was
like
we're
just
going
to
leave
that
there
with
like
no
surprises.
B
B
Because
we've
copied
one
and
injected
in
a
different
superclass
hierarchy,
so
I
guess
that
now
makes
a
lot
more
sense
why
it
doesn't
see
sub
muscles
included,
but
yeah.
It's
interesting,
because
I
didn't
really
touch
on
the
constants
table,
whether
it's
shared
or
not
shared
so
kind
of
intrigued.
By
that
now.
A
I
found
it
interesting
that
internally,
ruby
implements
modules
as
classes
and
they
basically
just
strip
out
portions
of
it.
I
wonder
what
the
genesis
of
that
was.
Was
it
just
easier
for
them
to
do
it?
That
way
was
that
clearly
it
has
to
be
intentional
after
all
these
years,
that
they
left
it
that
way,
but
wondering
what
the
original
reasoning
was.
B
C
Yeah,
I
would
speculate
that
like
if
the
intent
was
everything
as
an
object,
then
maybe
that
was
just
an
easy
way
to
to
say.
Well,
we
want
these
things
that
are
like
classes,
but
not
we
want
to
make
sure
they're
objects,
so
we'll
just
you
know,
use
our
existing
structure,
but
I
would
be
curious
that,
like
yeah
over
the
years,
I
I
wonder
if
there's
been
investigations
into
you
know
like
the
efficiency
gains
versus
losses,
if
that
was
if
that
were
to
be
split
out
in
any
way.
A
C
B
You're
you're,
what
was
the
is
it
professor
class
should
not
be
inheriting
from
your
mathematician
class
backwards.
This
doesn't
seem
right.
It.
C
Didn't
keep
bothering
me
that
the
way
the
diagrams
were
laid
out
was,
it
would
have
like
the
the
class,
and
then
a
super
was
pointing
down
like
the
super
should
be
pointing
up.
Yes,.
A
C
Yoke
down,
I
think,
at
the
beginning
of
the
chapter
they
even
said
the
super
class
should
be
considered
the
base
of
the
tree.
B
A
To
it
yeah
the
majority
of
my
career
is
in
c
plus,
plus
and
c
sharp,
and
so
oh
I'm
so
sorry.
A
Language
is
fine,
it's
just
you
got
to
bring
the
whole
framework
along
with
it
to
get
it
to
work
right.
So
I
keep
drawing
parallels
to
those
like
okay.
What
was
that
in
c
sharp
and
trying
to
figure
out
all
these
things
and
there's
in
the
upcoming
chapter
there's
a
lot
more
parallels
in
seven,
which
I
read
last
week
so,
but
the
whole
name
spacing
thing
is
very
familiar
to
me
in
c
sharp
to
disambiguate.
A
A
To
compare
the
two
and
clearly
c
sharp
and
all
the.net
languages
and
asp.net
are
newer
than
ruby
derivatives.
So
it's
clear
who
stole
from
whom
on
a
lot
of
these
constructs
because,
like
asp.net
asp.net
mvc
is
basically
just
a
ripoff
of
ruby
on
rails
and
I
think
they
admitted
that
I
don't
think
they're
trying
to
hide
anything.
But
they
are
strikingly
similar.
A
A
A
You
can
wrap
events
around
when
actions
execute.
You
can
do
before
action
on
action
after
action
so
like
the
the
common
use
case,
is
global
logging,
so
you
can
get
like
a
centralized
login
repository
of
everything
that
happens
in
your
application,
and
I
just
don't
know
if
ruby
on
rails
has
something.
A
C
Yeah,
I
think
well,
we
have,
I
mean
the
way
you're
describing
it
reminds
me
of
like
it's
call
back
methods
which
so
on
rails
controllers.
You
can
have
like
a
before
and
then
after
and
a.
B
C
Various
versions
of
like
before
actions
and
you
can
define
a
method
to
wrap
around
or
before
a
controller
action,
and
you
can
also
do
it
with
model
validation.
So
you
can
do
things
before
it
saves
or
before
after.
C
A
C
C
Controllers
and
they
call
it
yeah,
it's
called
filters,
but
it's
always
called
a
before
action,
which
is
like
how
we
handle
authentication
a
lot
okay
and
then
for
models.
There
is.
A
Yeah
gotten
that
totally
stole
from
filters
too,
because
they
do
have
built-in
filters,
like
authentication,
filter
that
you
can
just
mark
up
with
attributes.
So
it
knows
to
go
authenticate
every
single
call
that
you
mark
with
that
basic
authentication
attribute
or
if
you
want
to
create
your
own
custom
authentication
attribution.
If
you
can.
C
And
I
know
that
there's
like
a
mixed
philosophy
on
specifically
with
the
active
record
callbacks,
whether
or
not
they're,
a
good
idea,
because
it
essentially
kind
of
hides
code
and
crea
can
create
side
effect
type
behavior.
But
it's
they're
all
throughout
gitlab's
code.
So.
A
For
the
segway
yeah
or
the
the
going
off
topic.
C
It's
not
actually,
it
was
interesting.
I
was
reading.
This
is
another
total
side
thing
I
I
think
I
actually
might
have
mentioned
last
time
like
talking
about
design
patterns,
and
I
happened
to
read
something
about
the
adapter
pattern
which
I've.
Never
I
mean
I
don't.
I
never
really
am
I'm
familiar
with
these
patterns,
but
it's
it
is
the
pattern
that's
used
to
create
the.
C
What
do
they
call
it,
the
the
asp
trees
when
you're
creating
a
new
language,
so
I
think,
like
in
chapter
one
and
chapter
two
here
it
was
like
you
know
it.
It
goes
and
tokenizes
every
single
word
of
code
and
then
builds
out
this
tree
that
will
be
compiled
pretty
much
or
parsed,
and
that
is
what
the
adapter
pattern
is,
which
I
thought
was
very
interesting
like
if
you
wanted
to
create
a
language
or
a
custom
style
of
language
out
of
another
existing
language,
that's
what
you
would
be
using.
B
A
A
I
I
had
a
hard
time
with
the
original
book,
because
there
weren't
enough
concrete
implementations
of
it,
and
then
I
I
think
it
was
dot
factory
is
the
name
of
the
website.
They
had
some
really
good
implementation
details
in
c-sharp
of
all
of
the
different
patterns
that
were
out
there,
so
that
became
a
good
reference
for
me
over
and
over.
When
I
was
thinking
about
things,
I
don't
know
of
a
good
one
for
ruby
languages,
though.
C
B
C
B
C
B
Right
right
so
like
activerecord
is
a
database.
Adapter
pattern
makes
sense
yeah,
so
like
learning
patterns
is
one
thing
and
just
sort
of
like
understanding
like
what
this
pattern
kind
of
is
maybe
what
it
does
and
having
a
code
example
that
kind
of
shows
it,
but
I
feel
like
what
brings
it
home
to
me,
is
usually
when
you
can
find
a
refactor,
so
somebody
started
with
something
and
then
they
used
patterns
to
end
up
with
something
cleaner
yeah.
B
I
feel
like
that
usually
connects
a
little
bit
better
to
me,
because
I
usually
start
with
the
something
that's
a
mess.
It's
like.
How
do
I
transform
this
into
something
less
messy
yeah,
so
I
think
that
just
takes
time
with
practicing
the
patterns
until
you
understand
like
how
they
can
clean
up
some
things
or
how
they
can
interact
with
each
other
to
make
things
easier
to
follow.
A
There's
a
continuing
down
the
side,
adventure
yeah,
having
actually
read
these
and
then
later
on,
while
you're
working
on
something
like.
Oh
my
god,.
A
Until
oh,
that's
how
you
do
it,
because
I
remember
I
encountered
a
piece
of
code
that
had
you
know,
50
either
case
statements
or
if
then
statements,
I'm
like.
Oh,
my
god,
I
read
a
pattern
on
this.
I
think
it
was
like
it's
not
catalog
patterns.
I
don't
see
that
there,
but
basically
you
have
a
way
to
inspect
and
in
c
sharp
it's
reflection.
You
can
inspect
the
interface
to
see
what
it
does
and
say.
A
C
Yeah,
which
that's
also
like
in
rails,
you
would
have,
because
there
are
no
there's,
no
interface.
B
A
A
No,
what's
chapter
eight.
A
I
would
recommend
being
prepared
with
some
of
chapter
eight,
because
I
read
chapter
seven,
it's
incredibly
short
and
there's
not
a
ton
to
it.
Okay
chapter
six
was
short:
oh
yeah,
it
does
look
short,
but
it
had
two
pieces
of
content
right.
We
had
modules
and
constants,
so
chapter
eight
is
going
to
be
like
one
of
those.
B
Sounds
good
I'd
be
all
for
know,
trying
to
play
catch
up
catch
up
to
the
emea,
people
yeah.