Class: Tripwire::Server::FingerprintsResource
Instance Method Summary
collapse
#initialize
Instance Method Details
#get(visitor_id) ⇒ Object
205
206
207
|
# File 'lib/tripwire/server/client.rb', line 205
def get(visitor_id)
@client.request_json("GET", "/v1/fingerprints/#{CGI.escape(visitor_id)}")[:data]
end
|
#iter(limit: nil, search: nil, sort: nil) ⇒ Object
209
210
211
212
213
214
215
216
217
218
219
220
|
# File 'lib/tripwire/server/client.rb', line 209
def iter(limit: nil, search: nil, sort: nil)
Enumerator.new do |yielder|
cursor = nil
loop do
page = list(limit: limit, cursor: cursor, search: search, sort: sort)
page.items.each { |item| yielder << item }
break unless page.has_more && page.next_cursor
cursor = page.next_cursor
end
end
end
|
#list(limit: nil, cursor: nil, search: nil, sort: nil) ⇒ Object
195
196
197
198
199
200
201
202
203
|
# File 'lib/tripwire/server/client.rb', line 195
def list(limit: nil, cursor: nil, search: nil, sort: nil)
payload = @client.request_json("GET", "/v1/fingerprints", query: {
limit: limit,
cursor: cursor,
search: search,
sort: sort
})
list_result(payload)
end
|