Exception: Ogc::Errors::ExceptionReport
- Defined in:
- lib/ogc/errors/exception_report.rb
Constant Summary collapse
- ROOTS =
%w( ServiceExceptionReport ExceptionReport ).freeze
Instance Attribute Summary collapse
-
#report ⇒ Object
readonly
Returns the value of attribute report.
Class Method Summary collapse
Instance Method Summary collapse
- #at_xpath(xpath) ⇒ Object
-
#initialize(report) ⇒ ExceptionReport
constructor
A new instance of ExceptionReport.
- #version ⇒ Object
- #xpath(xpath) ⇒ Object
Constructor Details
#initialize(report) ⇒ ExceptionReport
Returns a new instance of ExceptionReport.
16 17 18 19 20 |
# File 'lib/ogc/errors/exception_report.rb', line 16 def initialize(report) raise ArgumentError unless self.class.exception?(report) @report = report super() end |
Instance Attribute Details
#report ⇒ Object (readonly)
Returns the value of attribute report.
8 9 10 |
# File 'lib/ogc/errors/exception_report.rb', line 8 def report @report end |
Class Method Details
.exception?(report) ⇒ Boolean
11 12 13 |
# File 'lib/ogc/errors/exception_report.rb', line 11 def exception?(report) ROOTS.include?(report.root.name) end |
Instance Method Details
#at_xpath(xpath) ⇒ Object
22 23 24 |
# File 'lib/ogc/errors/exception_report.rb', line 22 def at_xpath(xpath) @report.at_xpath(xpath) end |
#version ⇒ Object
30 31 32 33 |
# File 'lib/ogc/errors/exception_report.rb', line 30 def version xpath = @report.at_xpath('/*/@version') xpath ? xpath.text : nil end |
#xpath(xpath) ⇒ Object
26 27 28 |
# File 'lib/ogc/errors/exception_report.rb', line 26 def xpath(xpath) @report.xpath(xpath) end |