# Inheritance fail

**URL:** <https://www.ruby-forum.com/t/inheritance-fail/148302>\
**Category:** Rails\
**Created:** [September 11, 2008, 3:22pm UTC](https://www.ruby-forum.com/t/inheritance-fail/148302 "2008-09-11T15:22:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![flamingflamingo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/f14d63/32.png) [@flamingflamingo](https://www.ruby-forum.com/u/flamingflamingo)\
**Post date:** [September 11, 2008, 3:22pm UTC](https://www.ruby-forum.com/t/inheritance-fail/148302/1 "2008-09-11T15:22:51Z")

</div>

Hi guys,  
I’m building a class that handles functions for both IE and FF.  
The trubble is that when I pass a class (e.g. for IE), I can’t use  
normal functionality.  
A wee example below. the browser.goto(“[http://www.nu.nl](http://www.nu.nl)”) command  
fails.

class BIE \<IE  
def initialize  
#@ff = FireWatir::Firefox.new()  
#@IE = Internetexplorer.new()  
@strBrowserType = ‘IE’  
@browser ||= Watir::IE.new; @browser.speed = :fast  
puts “new IE instance”  
end

def talk  
puts “talking IE”  
end

def ggoto(url)  
@browser.goto(url)  
end  
end

class Browser

def initialize  
#@browserIE = new BIE  
#@browserFF = new BFF  
@strBType = “FF”

```
#@browserIE.retrieveSettings()
#@strBType = @browserIE.getBrowserType()

```

end

def BrowserChoice()  
# case select  
# what browser in start.xls  
# end  
puts “in browserchoice”  
test = BIE.new

```
 return test

```

end

end

#option 1  
b = Browser.new  
browser = b.BrowserChoice  
browser.talk()  
browser.goto(“[http://www.nu.nl](http://www.nu.nl)”)
