Refactoring-of-Self



Refactoring-of-Self

0 0


Refactoring-of-Self

Slides for Refactoring of Self Talk

On Github vaidehijoshi / Refactoring-of-Self

Refactoring of Self

Vaidehi Joshi

@vaidehijoshi

def grouped_items
    items_by_category = {}
    items = Item.all.collect { |i| [i.category, i.name] }

    items.each do |category, item|
        if items_by_category[category]
          items_by_category[category] << item
        else
          items_by_category[category] = [item]
        end
    end

      items_by_category
    end
 end
def grouped_items
    Item.all.each_with_object({}) { |i, hash| (hash[i.category] ||= []) << i }
end
def grouped_items
    Item.all.group_by(&:category)
end

😻

😿

🙀

?!?

self

self.send_message

send_message

self.send_message

code.refactor

self

learning

be better

perfect iteration of self

😺

self.refactor

Refactoring of Self Vaidehi Joshi @vaidehijoshi