Exception: Hikvision::ResponseError

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/hikvision/isapi.rb

Instance Method Summary collapse

Constructor Details

#initialize(xml) ⇒ ResponseError

Returns a new instance of ResponseError.



6
7
8
9
# File 'lib/hikvision/isapi.rb', line 6

def initialize(xml)
  @xml = xml
  super(status_string)
end

Instance Method Details

#status_codeObject



11
12
13
# File 'lib/hikvision/isapi.rb', line 11

def status_code
  @xml.at_xpath('ResponseStatus/statusCode').inner_html.to_i
end

#status_stringObject



15
16
17
# File 'lib/hikvision/isapi.rb', line 15

def status_string
  @xml.at_xpath('ResponseStatus/statusString').inner_html
end

#sub_status_codeObject



19
20
21
# File 'lib/hikvision/isapi.rb', line 19

def sub_status_code
  @xml.at_xpath('ResponseStatus/subStatusCode').inner_html
end