The point is `self.tag_types` and `instance.tag_types` won't return the
same thing.
It is really important to keep the respective behavior for self and
instance.
If I use one the methods above it will only work for the class method.

Le lun. 5 dc. 2016  15:11, Aleksey Ivanov <ialexxei / gmail.com> a crit :

> def self.tag_list
>   list = {}
>   tag_types.each do |context|
>     list[context] = tags_on(context)
>   end
>   list
> end
>
> you definitely should use reduce
>
> def self.tag_list
>   tag_types.reduce({}) do |memo, context|
>     list.merge context => tags_on(context)
>   end
> end
>
> On Mon, Dec 5, 2016 at 5:06 PM, Kirk Haines <wyhaines / gmail.com> wrote:
>
> On Mon, Dec 5, 2016 at 5:34 AM, Terry Raimondo <terry.raimondo / gmail.com>
> wrote:
>
>
> def self.tag_list
>   list = {}
>   tag_types.each do |context|
>     list[context] = tags_on(context)
>   end
>   list
> end
>
> def tag_list
>   list = {}
>   tag_types.each do |context|
>     list[context] = tags_on(context)
>   end
>   list
> end
>
>
>
>
> def self.tag_list
>   list = {}
>   tag_types.each do |context|
>     list[context] = tags_on(context)
>   end
>   list
> end
>
> def tag_list
>   self.class.tag_list
> end
>
>
> Kirk Haines
>
>
> Unsubscribe: <mailto:ruby-talk-request / ruby-lang.org?subject=unsubscribe>
> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
>
>
>
> Unsubscribe: <mailto:ruby-talk-request / ruby-lang.org?subject=unsubscribe>
> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
>
-- 
Terry Raimondo
(supressed text/html)
Unsubscribe: <mailto:ruby-talk-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>