Hash

In that case I was trying to follow as much as possible the poodr
philosophy, trying hard to minimize the api of the objects I created. I
have found that small apis lower the possibility of future couplings. For
that linked list in particular, it was not necessary to modify the head or
even read it, the methods are simple and the implementation details are
hidden from the user.

One word of caution, consider that many of those linked list were plain
sandboxing to explore Enumerators and Enumerable, blocks, POODR concepts,
etc. A mess, in summary.

On Wed, Oct 29, 2014 at 5:02 PM, Brook Riggio <notifications@github.com>
wrote:

> In lib/linked_list/linked_list.rb:
>
> > +    val
> > +  end
> > +
> > +  def to_s
> > +    val.to_s
> > +  end
> > +
> > +  private
> > +
> > +  attr_writer :val, :nexxt
> > +end
> > +
> > +class LinkedList
> > +  private
> > +
> > +  attr_accessor :head
>
> Why does this attr_accessor need to be private?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/sotoseattle/data-structures/pull/7/files#r19581262>.
>