Class: Experian::Report

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

Direct Known Subclasses

CreditReport, TradeReport

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Report

Returns a new instance of Report.

Raises:

  • (error)


8
9
10
11
12
13
14
15
16
# File 'lib/experian/report.rb', line 8

def initialize(response)
  @response = response
  @url = response.env.url.to_s
  @raw_xml = response.body
  MultiXml.parser = :rexml
  @xml = MultiXml.parse(@raw_xml)

  raise error, error_message if error
end

Instance Attribute Details

#raw_xmlObject (readonly)

Returns the value of attribute raw_xml.



6
7
8
# File 'lib/experian/report.rb', line 6

def raw_xml
  @raw_xml
end

#responseObject (readonly)

Returns the value of attribute response.



6
7
8
# File 'lib/experian/report.rb', line 6

def response
  @response
end

#urlObject (readonly)

Returns the value of attribute url.



6
7
8
# File 'lib/experian/report.rb', line 6

def url
  @url
end

#xmlObject (readonly)

Returns the value of attribute xml.



6
7
8
# File 'lib/experian/report.rb', line 6

def xml
  @xml
end