Squashed:

FIX: Fix for #218

REFACTOR: proc instead of if statement as suggested by @Daxter

FIX: syntax error

CHG: unified getting a name of resource class