class Dirigible::DeviceInformation::List
Public Class Methods
new(response)
click to toggle source
# File lib/dirigible/device_information.rb, line 103 def initialize(response) @response = response end
Public Instance Methods
[](value)
click to toggle source
# File lib/dirigible/device_information.rb, line 107 def [](value) @response[value] end
next_page(params = {})
click to toggle source
Fetch the next page for this device listing. Returns nil if next_page
is nil.
# File lib/dirigible/device_information.rb, line 113 def next_page(params = {}) return nil if @response[:next_page].nil? uri = URI.parse(@response[:next_page]) path = "/#{uri.path.gsub(/\/api\/|\//, '')}" # Shew! Need to simplify this! params = (CGI.parse(uri.query).map{ |k,v| { k => v[0] } }.reduce({}) { |h,pairs| pairs.each { |k,v| (h[k.to_sym] = v) }; h }).merge!(params) List.new(Dirigible.get(path, params)) end