Class: Casper::Report

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#templateObject

Returns the value of attribute template.



49
50
51
# File 'lib/casper-client.rb', line 49

def template
  @template
end

#typeObject

Returns the value of attribute type.



49
50
51
# File 'lib/casper-client.rb', line 49

def type
  @type
end

#xmlObject

Returns the value of attribute xml.



49
50
51
# File 'lib/casper-client.rb', line 49

def xml
  @xml
end

#xpathObject

Returns the value of attribute xpath.



49
50
51
# File 'lib/casper-client.rb', line 49

def xpath
  @xpath
end

Instance Method Details

#to_jsonObject



51
52
53
54
55
56
57
58
59
60
# File 'lib/casper-client.rb', line 51

def to_json
  {:casper =>
        {
          :jrxml => Base64.encode64(self.template.read),
          :data => Base64.encode64((self.xml.kind_of? File) ? self.xml.read : xml),
          :xpath => self.xpath,
          :type => self.type
        }
  }.to_json
end