On 14/05/07, Vipul [EMAIL PROTECTED] wrote:
class LoginInput
@@userName = Vipul.Goyal
end
$ie.text_field(:id,txtLoginID).set(LoginInput.userName)
I think the OO idea is that the client should not be able to directly
access a variable outside a class.
code
class Login_Input
On 14/05/07, Vipul [EMAIL PROTECTED] wrote:
class LoginInput
@@userName = Vipul.Goyal
end
$ie.text_field(:id,txtLoginID).set(LoginInput.userName)
I think the OO idea is that the client should not be able to directly
access a variable outside a class.
code
class Login_Input
Ah, you're using a class variable and you have no accessor methods so it's
only available to . You'll need to add a class accessor or an instance
method if you're creating object of type LoginInput to get at the value:
class LoginInput
@@user_name = Vipul.Goyal
def LoginInput.user_name
On 14/05/07, Charley Baker [EMAIL PROTECTED] wrote:
class LoginInput
@@user_name = Vipul.Goyal
def LoginInput.user_name
@@user_name
end
end
puts LoginInput.user_name
= Vipul.Goyal
# Now with instance:
class LoginInput
@@user_name = Vipul.Goyal
def user_name
Hey aidy,
There aren't any attribute accessors for class variables. Why? You could I
suppose, but you'd want to keep them accessible only by methods in the
class. I think I'm starting to understand your general question or I could
be totally offbase.
Say for instance to take a classic example
Looks like user_Name is not defined for your LoginInput class. Check your
casing and make sure it exists there. Might be something like user_name, not
user_Name. Otherwise we'd have to have more information on your LoginInput
class.
-Charley
On 5/11/07, Vipul [EMAIL PROTECTED] wrote:
now i am