Class: Casper::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/casper-client.rb

Constant Summary collapse

@@options =
{
  :host => 'http://casper.jrs-labs.com:8080',
  :type => 'pdf'
}

Class Method Summary collapse

Class Method Details

.options(options = {}) ⇒ Object



34
35
36
# File 'lib/casper-client.rb', line 34

def self.options options={}
  @@options.merge!(options)
end

.pdf(options = {}) ⇒ Object



14
15
16
17
# File 'lib/casper-client.rb', line 14

def self.pdf options={}
  options[:type] = 'pdf'
  self.report options
end

.report(options = {}) ⇒ Object



24
25
26
27
28
29
30
31
32
# File 'lib/casper-client.rb', line 24

def self.report options={}
  options = @@options.merge!(options)
  Client.build options do |report| 
    report.template = options[:template]
    report.xml = options[:xml]
    report.xpath = options[:xpath]
    report.type = options[:type]
  end
end

.xls(options = {}) ⇒ Object



19
20
21
22
# File 'lib/casper-client.rb', line 19

def self.xls options={}
  options[:type] = 'xls'
  self.report options
end