Class: Bjt::Browser

Inherits:
Object
  • Object
show all
Defined in:
lib/bjt/browser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url) ⇒ Browser

Returns a new instance of Browser.



7
8
9
# File 'lib/bjt/browser.rb', line 7

def initialize(url)
  @url = url
end

Instance Attribute Details

#urlObject (readonly)

Returns the value of attribute url.



5
6
7
# File 'lib/bjt/browser.rb', line 5

def url
  @url
end

Instance Method Details

#openObject



11
12
13
14
15
# File 'lib/bjt/browser.rb', line 11

def open
  Launchy.open(url) do |exception|
    puts "Attempted to open '#{url}' and failed because #{exception}"
  end
end