Method: JSS::Matchable#match

Defined in:
lib/jss/api_object/matchable.rb

#match(term, api: JSS.api) ⇒ Array<Hash>

Perform a match, returning an Array of Hashes, one for each item matched

At the moment, it appears the search is an “exact match” search regardless of the prefs of the user connected to the API.



89
90
91
92
93
# File 'lib/jss/api_object/matchable.rb', line 89

def match(term, api: JSS.api )
  raise JSS::InvalidDataError, "Match term may not be empty" if term.to_s.empty?
  rsrc = "#{self::RSRC_BASE}/#{JSS::Matchable::MATCH_RSRC}/#{CGI.escape term.to_s}"
  api.get_rsrc(rsrc)[self::RSRC_LIST_KEY]
end