►
Description
Discussion for Chapter 9: “Metaprogramming”
A
So
as
craig
and
I
were
both
meant
to
do-
we
kind
of
the
first
part
was
mostly
like
we
were
there
and
then
the
second
part
we
kind
of
just
skimmed
or
maybe
even
lost
it
all
together.
So
how
did
you
do
steve.
B
C
C
I
was
just
in
the
middle
of
giving
my
summary
of
the
of
what
I
thought
of
the
chapter,
so
scoping
methods
determining
what
you
would
have
access
to
and
I
walked
away
from
it
thinking
why?
Why
would
you
want
to
do
any
of
this?
To
be
honest,
I
mean
if,
if
you're
already
in
the
code,
why
would
you
need
some
of
these
things
just
seem
super
hacky
to
me.
So
why?
Wouldn't
you
just?
Do
it
the
right
way
instead
of
the
meta
program?
C
So
I
I
don't
know
you
guys
that
write
much
more
code
than
I
do.
Why
would
you
use
any
of
this
meta
programming.
A
From
my
experience,
I
think
rails
does
a
lot
of
this
under
the
hood,
so
any
trying
to
think
if
it's
like
active
record
or
if
it's
like
all
of
the
like
hooks
and
callbacks,
and
things
like
that,
like
they
do
a
lot
of
meta
programming,
where
they
kind
of
outline
at
a
high
level
like
what
you
know,
maybe
what
the
callback
does
and
then
they
define
a
whole
bunch
of
them
and
that
automatically
creates
methods
for
you
to
call-
and
I
don't
know
if
there's
an
advantage
to
doing
that,
to
doing
the
meta
programming
route
versus
doing
something
like
a
method
missing
and
then
looking
it
up
on
the
fly.
A
B
I
think
I
agree
with
that,
where
rails
in
particular,
does
have
a
fair
amount
of
meta
programming
under
the
hood,
like
the
one
that
I
think
about
is
attribute
accessor
and
attribute
reader.
I
believe
those
use
meta
programming
to
dynamically
create
the
center
and
getter
methods.
Well,
actually,
those
are
written
in
cnn.
Aren't
they,
but.
B
Level
but
yeah
there's
things
like
that
or
or
the
way
that
the
the
conventions
of
of
model
naming
and
you
know
knowing
what
files
are
going
to
be
connected
to
what
and
what
controllers
are
connected
to,
what
views
that
that
all
uses
some
meta
programming
under
the
hood.
So
I
think
the
idea
is
that
you
have
this
possibly
confusing
meta
programming
happening,
but
if
it's
robust
and
it
creates
a
convention
that
everyone
follows
it
can
allow
for
an
easier
time.
For
you
know
your
everyday
programming,
which
is
when
we're
actually.
D
B
B
One
of
the
things
that
that
stuck
out
to
me
was-
I
think
I
mentioned-
I
don't
know
one
or
two
times
ago,
comparing
some
of
these
things
to
ideas
in
javascript,
and
I
thought
it
was
interesting
how
all
of
this
deals
with
passing
around
the
lexical
scopes.
There
was
mention
of
using
binding,
binding.
D
B
A
It's
getting
more
implicit
in
javascript
with
the
was
it
the
rock.
D
C
Don't
know
yeah
like
I
said
earlier,
I
don't
know
why
you
do
any
of
this
stuff,
but
yeah.
D
Some
parts
like
binding
and
other
stuff,
like
that.
That
was
why,
because
refine
was
starting
to
lose
me-
and
I
was
just
thinking
exactly
that
like
this-
is
interesting
but
where's
where's,
the
simon
value
here
and
then
then
got
up
to
bind
and
that
felt
more
familiar.
Just
because
I
had
some
context
that
when
you
would
do
stuff
with
that,
just
like
changing
the
object
that
you're
running
stuff
on.
I
thought
that
makes
some
sense.
But
I
didn't
really
know
the
use
case
for
using
refine
and
using.
A
Syntax
and
we
use
it
there,
but
I
I
had
no
idea
that
that
was
overriding
anything.
I
thought
it
was
just
like
adding
in
some
extra
some
extra
stuff
in
there,
but
I
guess
when
we
think
technically
I
guess
you're
overwriting,
maybe
the
pipe.
I
don't
know
what
you're
overwriting
in
that
case.
D
A
A
A
A
It's
it's
like
inside
of
a
I
mean
you
could
I
put
it
inside
that
context,
a
specific
context
block
or
even
in
yeah
a
context
or
a
describe
block,
and
it.
A
Or
refinements
now
allows
you
to
call
them
at
other
scopes.
I
don't
know,
I
know
yeah,
but
it
also
got
me
thinking
about
like
our
ce
versus
ee
and
like
would
this
be
applicable
to
that.
Would
that
work
that
way
or
not,
because
when
we
like
override
some,
you
know
models,
for
example,
like
I
can
think
of
like
the
gitlab
subscription.
One
is
pretty
useless
in
ce
because
it
doesn't
do
anything
but
in
ee.
It
suddenly
has
all
of
these
methods
to
do
things
because
you
actually
have
plans
and
subscriptions.
A
D
C
Someone
in
the
other
meeting
found
one
example.
If
you
look
at
their
meta
programming,
chapter
and
steve's
clicking
on
the
link
there.
A
Whatever
this
article
is
about,
it
looks
interesting
yeah,
so
I
had
some
questions
about
that
because,
like
earlier
in
the
book,
when
they
sort
of
introduced
this
concept
of
refinements,
I
was
like
ooh
like
a
new
thing
in
ruby
that
I'm
not
aware
of
like
what
does
this
do
now
that
we're
here
I'm
like,
I
still
don't
know.
What
does
this
do?
D
A
Yeah,
I
was
also
really
curious
about
the
concept
of
the
what
they
call
it
the
singleton
class.
A
So
if
you
have
an
object,
you
say
like
def,
object,
dot,
method
and
it
creates
the
singleton
class
on
the
fly
to
put
that
that
method
definition
into
I
was
like.
Can
you
then
say
object.singleton
class
and
get
that
newly
created
class,
or
does
it
still
go
to
some
other
class?
And
I
didn't
have
time
to
try
it
out.
So
I'm
just
going
to
sit
here
and
use
about
it.
B
I'm
trying
to
remember
how
they
because
it
it
points
to
a
r
class,
which
I
think
we
learned
earlier
is
just
another
like,
even
though
it
points
to
its.
You
know
like
a
new
singleton
class,
it's
just
another
of
the
same
pattern
that
we've
seen
in
the
in
previous
chapters
when
we
looked
at
classes
and
objects.
A
A
A
A
I
had
another
question
about
like
the
refinements,
which
I
think
I
just
need
to
read
a
more
in-depth
article
about
refinements,
but
they
were
talking
about
how
every
time
you
you
add
a
method
to
sort
of
the
refined
block
it
tracks
that
with
the
actual
class
and
it
updates
the
type
to
be
via
method
type
refined
or
whatever,
so
that
it
knows
later,
like
hey,
this
method
might
be
refined.
A
I'm
just
wondering
like
what
happens
if
you
try
to
refine
a
method
that
doesn't
exist
yet
like
does
it
blow
up?
Does
it
just
make
a
new
method
like
how.
C
Why,
I
think,
probably
the
more
advanced
developer?
You
are
and
no
insult
intended
to
anybody
on
this
call
or
watching
this,
but
you
know
you'll
probably
go
oh
yeah.
I
can
use
something
in
meta
programming
to
solve
this
problem
more
quickly
than
restructuring
the
code.
The
way
I
want
it,
so
maybe
that's
it,
but
right
now
I
just
I.
I
don't
know
why
I
would
use
any
of
this
stuff.
A
Actually
now
that
not
you
say
that
I'm
thinking
about
it
in
terms
of
if
it's
something
you
want
to
change,
that's
outside
of
your
domain,
so
you're
using
a
gem
and
they
have
a
method
that
has
some
bug
in
it
or
something,
and
you
don't
want
to
go
fork.
It
make
your
own
version,
pull
it
in
that,
whatever
you
just
say,
I'm
just
going
to
refine
that
method,
which
you
could
also
just
reopen
the
class
and
re-define
it,
but.
A
A
A
A
A
A
C
B
D
A
Yeah
cool
well
always
pleasure.
Everybody
and.