On Wed, 4 Apr 2007, aidy wrote:

> Hi,
>
> I have an ObjectMap class that contains other classes. I inherit from
> the base class.Could someone tell me how I can run a nested class
> method from the inherited class?
>
> Here is the code:
>
>
> <snip>
> class ObjectMap
>   @@ie = Watir::IE.new
>   #each page has a class where objects of that class are mapped
>   class Login
>     def username;@@ie.text_field(:name, 'user_name');end
>     def password;@@ie.text_field(:name, 'password');end
>     def remember_me;@@ie.checkbox(:name, 'remember_me');end
>     def sign_in;@@ie.button(:value, 'Sign in');end
>   end
>   class DashBoard
>       #more methods
>   end
> end
>
> class A_Test < ObjectMap
>
>    @@ie.goto('www.updatelog.com')
>    @@ie.maximize
>    #how do I run the username method?
>
> end
> <snip>
>
> Need to, for example, run the username method?
>
> Thanks
>
> aidy

many ways.  make it easy on yourself though

class ObjectMap
   def self.login() Login end
end

class A_Test < ObjectMap

    @@ie.goto('www.updatelog.com')
    @@ie.maximize
    #how do I run the username method?

    login.username

end


-a
-- 
be kind whenever possible... it is always possible.
- the dalai lama