I come from Java background. I was wondering if there was a way to have a class that stored constant values.
Specific to my problem, I was wondering if I could have something like:
@user.authentications.create(:uid => "12345", :provider => Provider::FACEBOOK)
where the Provider class stored all the static constants. Also, is this the right way to do it in Ruby on Rails?
Extra Info: I tried the above by having
class Provider
FACEBOOK = "facebook"
TWITTER = "twitter"
end
but it gave the error:
NameError:
uninitialized constant Provider