Method: Snitcher::API::Client#snitches
- Defined in:
- lib/snitcher/api/client.rb
#snitches(filters = {}) ⇒ Array<Snitcher::API::Snitch>
Get the list snitches on the account
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/snitcher/api/client.rb', line 64 def snitches(filters = {}) query = {} # Tags allow for labeling Snitches for better categorization. This allows # filtering by a set of tags. if = filters[:tags] = Array().flatten query[:tags] = .map(&:strip).compact.uniq.join(",") end # JSON array of Snitch attributes response = get("/v1/snitches", query) # Convert the attributes hashes into Objects response.map! do |snitch| Snitcher::API::Snitch.new(snitch) end end |