Skip to content

Instantly share code, notes, and snippets.

@LNA
Last active August 29, 2015 13:57
Show Gist options
  • Save LNA/9606852 to your computer and use it in GitHub Desktop.
Save LNA/9606852 to your computer and use it in GitHub Desktop.
Simple Refactor
def received(tweets)
tweets.each do |tweet|
if tweet.receiver == name
@received_tweets << tweet
end
end
@received_tweets
end
def received(tweets)
@received_tweets = tweets.select {|tweet| tweet.receiver == name}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment