Module: Xcal::Parktronic::Routes::Nested::DeviceErrors
- Included in:
- GenericResponse
- Defined in:
- lib/xcal/parktronic/routes/nested/device_errors.rb
Instance Method Summary collapse
-
#get_paged_device_errors(args = {}) ⇒ Object
(also: #get_device_errors)
Fetches device_errors for the specific metric Executed as a method chain from the GenericResponse object.
Instance Method Details
#get_paged_device_errors(args = {}) ⇒ Object Also known as: get_device_errors
Fetches device_errors for the specific metric Executed as a method chain from the GenericResponse object
Call example:
metric(id).get_device_errors(page: 2, per_page: 4)
Accepted attributes:
+page+ page number, defaults to 1
+per_page+ per page value, defaults to 100
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/xcal/parktronic/routes/nested/device_errors.rb', line 17 def get_paged_device_errors(args = {}) args.merge!(:access_token => client.access_token) response = client.get_response("/#{client.api_version}/metrics/#{id}/device_errors?#{URI.encode_www_form(args)}") generic_response = Xcal::Parktronic::GenericResponse.new(response.body, client) if response.code == '200' && generic_response.has_key?(:device_errors) generic_response.device_errors.map(&:device_error) else generic_response end end |