class CustomerClass < ActiveRecord
class << self
attr_reader :lov
end
attr_reader :lov1
end
What is the diffrence between attr_reader lov and lov1 ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The difference is that
:lovwill be a class-level accessor, while:lov1is instance-level.So, you can only access
lov1from an instance:While
CustomerClass.lov1wouldn’t work, butCustomerClass.lovwould.