Skip to content

Conversation

@var114
Copy link

@var114 var114 commented Nov 6, 2013

Hey Jesse,

Just completed everything...thanks for you comments, implemented them to this pull request.

Thanks,
Patil

watchman.rb Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Side note --- calling gets.chomp() is fine... but the () it optional. You could just call

day = gets.chomp.capitalize

or, if it suits you:

day = gets().chomp().capitalize()

It doesn't matter much -- though I recommend you pick a style and go with it for a codebase. Having devs each write differently makes code hard to understand at a glance.

@jwo
Copy link
Member

jwo commented Nov 6, 2013

Awesome stuff!

OK, last thing -- in Ruby, you can compose things very easily, like so: Coffee.all.to_a.select{|coffee| coffee == cof}.each do |coffee|

However, this can begin to get a little hard to read (as I'm sure you noticed). So, you can:

Coffee
  .all
  .to_a
  .select{|coffee| coffee == cof}
  .each do |coffee|
    puts coffe
  end

All up to you on what looks best. My "rule" if its 3 or more compositions, move to a new line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants