Last active
August 29, 2015 14:03
-
-
Save eriknomitch/f8b80f861f4c93eded93 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def self.user_types | |
[:candidate, :influencer, :employee] | |
end | |
User.user_types.each do |user_type| | |
define_method "#{user_type}?" do | |
!!send(user_type) | |
end | |
end | |
def is_type?(user_type) | |
user_type = user_type.to_sym | |
raise "Not a valid User type." unless User.user_types.member? user_type | |
send("#{user_type}?") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment