Refactoring frenzy

1 view
Skip to first unread message

Henrique Gregianin Testa

unread,
May 5, 2014, 9:46:21 PM5/5/14
to rail...@googlegroups.com
Nunca refatorei tantas vezes um método tão pequeno.. ahahaah
Alguém consegue melhorar? :P


Guilherme Goettems Schneider

unread,
May 5, 2014, 11:13:22 PM5/5/14
to rail...@googlegroups.com
Massa!

Achei mais uma:

class: status.slice("unsubscribed") || "delivery_#{status}"

Guilherme

--
You received this message because you are subscribed to the Google Groups "rails-rs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rails-rs+u...@googlegroups.com.
To post to this group, send email to rail...@googlegroups.com.
Visit this group at http://groups.google.com/group/rails-rs.
For more options, visit https://groups.google.com/d/optout.

Guilherme Goettems Schneider

unread,
May 6, 2014, 8:45:40 AM5/6/14
to rail...@googlegroups.com
Melhor ainda, slice pode ser substituido por []

class: status["unsubscribed"] || "delivery_#{status}"

Guilherme

Henrique Gregianin Testa

unread,
May 6, 2014, 8:23:22 PM5/6/14
to rail...@googlegroups.com

Boa! Não tinha me dado conta do slice.

Henrique
Reply all
Reply to author
Forward
0 new messages