Class: StraightShooter

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url, filename = nil) ⇒ StraightShooter

Returns a new instance of StraightShooter.



13
14
15
16
17
# File 'lib/straight_shooter.rb', line 13

def initialize(url, filename = nil)
  self.app = Qt::Application.new(ARGV)
  self.page = Page.new(url, filename)
  page.connect(page, SIGNAL('finished(bool)'), app, SLOT('quit()'))
end

Instance Attribute Details

#appObject

Returns the value of attribute app.



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

def app
  @app
end

#pageObject

Returns the value of attribute page.



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

def page
  @page
end

Class Method Details

.render(url, filename = nil) ⇒ Object



9
10
11
# File 'lib/straight_shooter.rb', line 9

def self.render(url, filename = nil)
  self.new(url, filename).run!
end

Instance Method Details

#runObject Also known as: run!



19
20
21
22
# File 'lib/straight_shooter.rb', line 19

def run
  page.load!
  app.exec
end